Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. 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.
  2.  
  3. $ cat app/test/index.js
  4. require('../src/routes/__test__/index');
  5.  
  6. $ cat src/routes/__test__/index.js
  7. require('./system');
  8.  
  9. $ cat src/routes/__test__/system.js
  10. const Lab = require('lab');
  11. const lab = exports.lab = Lab.script();
  12. const expect = require('expect.js');
  13. const server = require('../../server.js');
  14.  
  15. lab.experiment('Authentication', function () {
  16. lab.test('should fail due to incorrect password', function (done) {
  17. const payload = {
  18. username: 'trex',
  19. password: 'passworddd'
  20. };
  21.  
  22. const options = {
  23. method: 'POST',
  24. url: '/api/v2/auth',
  25. payload
  26. };
  27.  
  28. server.inject(options, function (response) {
  29. expect(response.statusCode).to.eql(401);
  30. expect(response.statusMessage).to.eql('Unauthorized');
  31. done();
  32. });
  33. });
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement