Guest User

Untitled

a guest
Nov 1st, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. express: 4.16.2,
  2. chai: 4.1.2,
  3. chai-http: 3.0.0,
  4. mocha: 4.0.1
  5.  
  6. (node:18804) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Forbidden
  7. (node:18804) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  8.  
  9. it('should reject solution entry because no data on /api/solution POST', (done) => {
  10. chai.request.agent(app.server)
  11. .post('/api/login')
  12. .send({ username: 'ADMIN', password: 'password' })
  13. .then(() => {
  14. return agent.post('/api/endpoint')
  15. .then((res) => {
  16. res.should.have.status(200);
  17. done();
  18. });
  19. });
  20. });
  21.  
  22. it('should reject solution entry because no data on /api/solution POST', (done) => {
  23. chai.request.agent(app.server)
  24. .post('/api/login')
  25. .send({ username: 'ADMIN', password: 'password' })
  26. .then((res) => {
  27. return agent.post('/api/endpoint')
  28. })
  29. .then((res) => {
  30. res.should.have.status(200);
  31. done();
  32. })
  33. .catch(err => {
  34. done(err);
  35. })
  36. });
Add Comment
Please, Sign In to add comment