Skip to content

Commit

Permalink
add failing post report query test ✅
Browse files Browse the repository at this point in the history
Relates #33 #34 #35
  • Loading branch information
haydnba committed May 19, 2018
1 parent 75bccbf commit ab2583b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/model/post_report.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const test = require('tape'); //eslint-disable-line
const request = require('supertest'); //eslint-disable-line
// require test database build script
const runDbBuild = require('../../model/database/db_build');
// require query functions
const { postReport } = require('../../model/queries/');

test('Test postChallenge query', (t) => {
runDbBuild()
.then((res) => {
t.ok(res);
return postReport(3, 3, 'This is a new test report');
})
.then((id) => {
t.ok(id, 'postReport returns new report id');
t.end();
})
.catch((e) => {
t.error(e);
t.end();
});
});

0 comments on commit ab2583b

Please sign in to comment.