Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The file: app/test/index.js includes a lab script that is not exported via exports.labnpm ERR! Test failed. See above for more details.
- $ cat app/test/index.js
- require('../src/routes/__test__/index');
- $ cat src/routes/__test__/index.js
- require('./system');
- $ cat src/routes/__test__/system.js
- const Lab = require('lab');
- const lab = exports.lab = Lab.script();
- const expect = require('expect.js');
- const server = require('../../server.js');
- lab.experiment('Authentication', function () {
- lab.test('should fail due to incorrect password', function (done) {
- const payload = {
- username: 'trex',
- password: 'passworddd'
- };
- const options = {
- method: 'POST',
- url: '/api/v2/auth',
- payload
- };
- server.inject(options, function (response) {
- expect(response.statusCode).to.eql(401);
- expect(response.statusMessage).to.eql('Unauthorized');
- done();
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement