mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Add test libs, update dependencies
This commit is contained in:
parent
cd6d929cbf
commit
16acd1b49c
24 changed files with 1692 additions and 159 deletions
0
server/test/fixtures/.gitkeep
vendored
Normal file
0
server/test/fixtures/.gitkeep
vendored
Normal file
0
server/test/integration/controllers/.gitkeep
Normal file
0
server/test/integration/controllers/.gitkeep
Normal file
0
server/test/integration/helpers/.gitkeep
Normal file
0
server/test/integration/helpers/.gitkeep
Normal file
19
server/test/integration/models/User.test.js
Normal file
19
server/test/integration/models/User.test.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
const { expect } = require('chai');
|
||||
|
||||
describe('User (model)', () => {
|
||||
before(async () => {
|
||||
await User.create({
|
||||
email: 'test@test.test',
|
||||
password: 'test',
|
||||
name: 'test',
|
||||
});
|
||||
});
|
||||
|
||||
describe('#find()', () => {
|
||||
it('should return 1 user', async () => {
|
||||
const users = await User.find();
|
||||
|
||||
expect(users).to.have.lengthOf(1);
|
||||
});
|
||||
});
|
||||
});
|
23
server/test/lifecycle.test.js
Normal file
23
server/test/lifecycle.test.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const dotenv = require('dotenv');
|
||||
const sails = require('sails');
|
||||
const rc = require('sails/accessible/rc');
|
||||
|
||||
process.env.NODE_ENV = 'test';
|
||||
|
||||
before(function beforeCallback(done) {
|
||||
this.timeout(5000);
|
||||
|
||||
dotenv.config();
|
||||
|
||||
sails.lift(rc('sails'), (error) => {
|
||||
if (error) {
|
||||
return done(error);
|
||||
}
|
||||
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
after(function afterCallback(done) {
|
||||
sails.lower(done);
|
||||
});
|
0
server/test/mocha.opts
Normal file
0
server/test/mocha.opts
Normal file
Loading…
Add table
Add a link
Reference in a new issue