mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Move notFound api v3 test to integration folder.
This commit is contained in:
13
test/api/v3/integration/notFound.test.js
Normal file
13
test/api/v3/integration/notFound.test.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { requester } from '../../../helpers/api-integration.helper';
|
||||||
|
|
||||||
|
describe('notFound Middleware', () => {
|
||||||
|
it('returns a 404 error when the resource is not found', () => {
|
||||||
|
let request = requester().get('/api/v3/dummy-url');
|
||||||
|
|
||||||
|
return expect(request).to.eventually.be.rejected.and.eql({
|
||||||
|
code: 404,
|
||||||
|
error: 'NotFound',
|
||||||
|
message: 'Not found.',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { requester } from '../../../../helpers/api-integration.helper';
|
|
||||||
|
|
||||||
describe('notFound Middleware', () => {
|
|
||||||
it('returns a 404 error when the resource is not found', () => {
|
|
||||||
let request = requester().get('/api/v3/dummy-url');
|
|
||||||
|
|
||||||
return request.then((errBody) => {
|
|
||||||
expect(errBody.error).to.equal('NotFound');
|
|
||||||
expect(errBody.message).to.equal('Not found.');
|
|
||||||
}).to.eventually.be.rejected.and.eql({
|
|
||||||
code: 404,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user