From d14e72b01bbb412e51cdd792d74815c068374ce9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 8 Feb 2017 14:26:19 +0900 Subject: [PATCH] [WIP] test --- package.json | 4 ++++ test/index.ts | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/index.ts diff --git a/package.json b/package.json index 4b7aaf6..4727322 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/index.ts b/test/index.ts new file mode 100644 index 0000000..691c362 --- /dev/null +++ b/test/index.ts @@ -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'); +});