Skip to content

Commit 2f73121

Browse files
author
App Generator
committed
Integrate JTest
1 parent 09464f4 commit 2f73121

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
coveragePathIgnorePatterns: ['node_modules'],
4+
coverageReporters: ['text', 'lcov', 'clover', 'html'],
5+
};

tests/basic.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
3+
Copyright (c) 2019 - present AppSeed.us
4+
5+
*/
6+
7+
const request = require('supertest')
8+
const app = require('../src/server')
9+
10+
describe("API tests", () => {
11+
12+
// The most basic test
13+
test("API should return a 200 status", done => {
14+
15+
request(app)
16+
.get("/api/users/testme")
17+
.then(response => {
18+
expect(response.statusCode).toBe(200);
19+
expect(response.body.success).toBe(true);
20+
done();
21+
});
22+
23+
});
24+
25+
});
26+

0 commit comments

Comments
 (0)