mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
[WIP] test
This commit is contained in:
parent
d1b3d53d3b
commit
95bf609512
2 changed files with 7 additions and 3 deletions
|
@ -2,6 +2,9 @@
|
||||||
* API TESTS
|
* API TESTS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// During the test the env variable is set to test
|
||||||
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
const chai = require('chai');
|
const chai = require('chai');
|
||||||
const chaiHttp = require('chai-http');
|
const chaiHttp = require('chai-http');
|
||||||
const should = chai.should();
|
const should = chai.should();
|
||||||
|
@ -9,8 +12,12 @@ const should = chai.should();
|
||||||
chai.use(chaiHttp);
|
chai.use(chaiHttp);
|
||||||
|
|
||||||
const server = require('../built/api/server');
|
const server = require('../built/api/server');
|
||||||
|
const db = require('../built/db/mongodb').default;
|
||||||
|
|
||||||
describe('API', () => {
|
describe('API', () => {
|
||||||
|
// Reset database
|
||||||
|
db.get('users').drop();
|
||||||
|
|
||||||
it('greet server', done => {
|
it('greet server', done => {
|
||||||
chai.request(server)
|
chai.request(server)
|
||||||
.get('/')
|
.get('/')
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
// During the test the env variable is set to test
|
|
||||||
process.env.NODE_ENV = 'test';
|
|
||||||
|
|
||||||
// Init babel
|
// Init babel
|
||||||
require('babel-core/register');
|
require('babel-core/register');
|
||||||
require('babel-polyfill');
|
require('babel-polyfill');
|
||||||
|
|
Loading…
Reference in a new issue