File tree 4 files changed +1960
-35
lines changed 4 files changed +1960
-35
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ "roots" : [
3
+ "<rootDir>/src"
4
+ ] ,
5
+ "transform" : {
6
+ "^.+\\.tsx?$" : "ts-jest"
7
+ } ,
8
+ "testRegex" : "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$" ,
9
+ "moduleFileExtensions" : [
10
+ "ts" ,
11
+ "tsx" ,
12
+ "js" ,
13
+ "jsx" ,
14
+ "json" ,
15
+ "node"
16
+ ] ,
17
+ }
Original file line number Diff line number Diff line change 5
5
"license" : " Apache-2.0" ,
6
6
"scripts" : {
7
7
"lint" : " tsfmt --verify" ,
8
- "start" : " ts-node ./bin/www.ts"
8
+ "start" : " ts-node ./bin/www.ts" ,
9
+ "test" : " npm run lint && jest --env node"
9
10
},
10
11
"dependencies" : {
11
12
"codechain-keystore" : " git://github.com/CodeChain-io/codechain-keystore.git#a168fc7eb01d31269d6e29ab9075315ae557471b" ,
25
26
"@types/debug" : " ^0.0.30" ,
26
27
"@types/express" : " ^4.16.0" ,
27
28
"@types/http-errors" : " ^1.6.1" ,
29
+ "@types/jest" : " ^23.3.1" ,
28
30
"@types/lodash" : " ^4.14.116" ,
29
31
"@types/morgan" : " ^1.7.35" ,
30
32
"@types/node-sass-middleware" : " ^0.0.30" ,
31
33
"@types/request-promise" : " ^4.1.42" ,
34
+ "@types/supertest" : " ^2.0.5" ,
35
+ "jest" : " ^23.5.0" ,
36
+ "superagent" : " ^3.8.3" ,
37
+ "supertest" : " ^3.1.0" ,
38
+ "ts-jest" : " ^23.1.3" ,
32
39
"tsc" : " ^1.20150623.0" ,
33
40
"tslint" : " ^5.11.0" ,
34
41
"tslint-config-prettier" : " ^1.14.0"
Original file line number Diff line number Diff line change
1
+ import { Application } from "express" ;
2
+ import { createApp } from "../app" ;
3
+ import * as request from "supertest" ;
4
+
5
+ let app : Application ;
6
+
7
+ beforeEach ( async ( ) => {
8
+ app = ( await createApp ( ) ) [ 0 ] ;
9
+ } ) ;
10
+
11
+ test ( "ping" , async ( ) => {
12
+ const response = await request ( app ) . get ( "/ping" ) ;
13
+ expect ( response . status ) . toBe ( 200 ) ;
14
+ } ) ;
You can’t perform that action at this time.
0 commit comments