From 00f0fd2d0730afc9d30bba89b1974e4c50dd5060 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 17 Jan 2017 07:51:27 +0900 Subject: [PATCH] [WIP] API testing --- README.md | 1 + package.json | 3 +++ src/server.ts | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index dc27993fe..bde4427a1 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ and more! You can touch with your own eyes at https://misskey.xyz/. 6. `npm run build` ## Test +ビルドしてから: `npm test` ## Setup diff --git a/package.json b/package.json index 9628a8922..f51c58363 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@types/bcrypt": "1.0.0", "@types/body-parser": "0.0.33", "@types/browserify": "12.0.30", + "@types/chai": "3.4.34", "@types/chalk": "0.4.31", "@types/compression": "0.0.33", "@types/cors": "2.8.0", @@ -43,6 +44,7 @@ "@types/is-root": "1.0.0", "@types/is-url": "1.2.28", "@types/js-yaml": "3.5.29", + "@types/mocha": "2.2.37", "@types/mongodb": "2.1.36", "@types/ms": "0.7.29", "@types/multer": "0.0.32", @@ -66,6 +68,7 @@ "body-parser": "1.15.2", "browserify": "13.3.0", "browserify-livescript": "0.2.3", + "chai": "3.5.0", "chalk": "1.1.3", "chart.js": "2.4.0", "compression": "1.6.2", diff --git a/src/server.ts b/src/server.ts index b8646efd1..bff4b86bc 100644 --- a/src/server.ts +++ b/src/server.ts @@ -54,3 +54,8 @@ server.listen(config.port, () => { // Send a 'ready' message to parent process process.send('ready'); }); + +/** + * Export app for testing + */ +module.exports = app;