[WIP] test

This commit is contained in:
syuilo 2017-02-08 14:26:19 +09:00
parent 6dfe2912a3
commit d14e72b01b
2 changed files with 25 additions and 0 deletions

View File

@ -12,12 +12,16 @@
"build": "gulp build"
},
"devDependencies": {
"@types/chai": "3.4.34",
"@types/debug": "0.0.29",
"@types/mocha": "2.2.39",
"@types/node": "7.0.5",
"@types/request": "0.0.39",
"chai": "3.5.0",
"event-stream": "3.3.4",
"gulp": "3.9.1",
"gulp-typescript": "3.1.4",
"mocha": "3.2.0",
"typescript": "2.1.5"
},
"dependencies": {

21
test/index.ts Normal file
View File

@ -0,0 +1,21 @@
/**
* Tests!
*/
import http from 'http';
import chai from 'chai';
import summaly from '../';
Error.stackTraceLimit = Infinity;
// During the test the env variable is set to test
process.env.NODE_ENV = 'test';
// Display detail of unhandled promise rejection
process.on('unhandledRejection', console.dir);
const should = chai.should();
it('well-defined meta site', async () => {
should.equal(await summaly('localhost:0'), 'hoge');
});