Skip to content

Commit

Permalink
fix: router unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kpoke committed May 22, 2022
1 parent a7bea3e commit 57dd87b
Show file tree
Hide file tree
Showing 13 changed files with 16,310 additions and 6,023 deletions.
10,700 changes: 10,356 additions & 344 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"dependencies": {
"@sentry/node": "^5.1.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"chai-uuid": "^1.0.6",
"dotenv": "^8.2.0",
"expect": "^26.4.2",
Expand All @@ -54,9 +53,9 @@
"uuid": "^8.2.0"
},
"devDependencies": {
"assert": "1.5.0",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"assert": "1.5.0",
"chai": "3.5.0",
"chai-as-promised": "7.1.1",
"chai-http": "^4.3.0",
Expand All @@ -72,16 +71,16 @@
"eslint-plugin-simple-import-sort": "^7.0.0",
"expect-runtime": "^0.7.0",
"faker": "^5.3.1",
"http-status-codes": "1.4.0",
"generate-password": "^1.6.0",
"http-status-codes": "1.4.0",
"husky": "^3.1.0",
"mocha": "^10.0.0",
"mock-knex": "^0.4.9",
"mocha": "^8.3.0",
"prettier": "^2.1.2",
"set-cookie-parser": "2.4.6",
"sinon": "^9.0.3",
"sinon-chai": "^2.14.0",
"supertest": "^4.0.2",
"set-cookie-parser": "2.4.6"
"supertest": "^4.0.2"
},
"directories": {
"doc": "docs"
Expand Down
23 changes: 11 additions & 12 deletions server/app.spec.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
const request = require('supertest');
const { expect } = require('chai');
const server = require("./app");
const server = require('./app');


describe("", () => {

it("Test header: content-type: application/json", async () => {
const res = await request(server)
.get('/');
expect(res.statusCode).eq(200);
describe('', () => {
it('Test header: content-type: application/json', async () => {
const res = await request(server).get('/');
expect(res.statusCode).eq(401);
expect(res.body).property('message').eql('Invalid access - no API key');
});

it("Test header: content-type: application/json", async () => {
const res = await request(server)
.post('/');
it('Test header: content-type: application/json', async () => {
const res = await request(server).post('/');
expect(res.statusCode).eq(415);
expect(res.body).property("message").match(/application.json/);
expect(res.body)
.property('message')
.match(/application.json/);
});
});
54 changes: 0 additions & 54 deletions server/handlers/authHandler.spec.js

This file was deleted.

157 changes: 0 additions & 157 deletions server/handlers/trustHandler.spec.js

This file was deleted.

Loading

0 comments on commit 57dd87b

Please sign in to comment.