Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- express: 4.16.2,
- chai: 4.1.2,
- chai-http: 3.0.0,
- mocha: 4.0.1
- (node:18804) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Forbidden
- (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.
- it('should reject solution entry because no data on /api/solution POST', (done) => {
- chai.request.agent(app.server)
- .post('/api/login')
- .send({ username: 'ADMIN', password: 'password' })
- .then(() => {
- return agent.post('/api/endpoint')
- .then((res) => {
- res.should.have.status(200);
- done();
- });
- });
- });
- it('should reject solution entry because no data on /api/solution POST', (done) => {
- chai.request.agent(app.server)
- .post('/api/login')
- .send({ username: 'ADMIN', password: 'password' })
- .then((res) => {
- return agent.post('/api/endpoint')
- })
- .then((res) => {
- res.should.have.status(200);
- done();
- })
- .catch(err => {
- done(err);
- })
- });
Add Comment
Please, Sign In to add comment