Resolve "Transition to ESLint"

This commit is contained in:
Thea Schöbl
2022-06-27 14:40:09 +00:00
committed by Rainer Killinger
parent ca1d2444e0
commit 418ba67d15
47 changed files with 1854 additions and 1634 deletions

View File

@@ -35,15 +35,14 @@ describe('App', async function () {
sandbox.restore();
});
it('should exit process if there is 20 seconds of pause after a request during the integration test', async function() {
it('should exit process if there is 20 seconds of pause after a request during the integration test', async function () {
const clock = sandbox.useFakeTimers();
let processExitStub = sandbox.stub(process, 'exit');
const processExitStub = sandbox.stub(process, 'exit');
// fake NODE_ENV as integration test
const restore = mockedEnv({
NODE_ENV: 'integration-test',
});
await testApp
.post('/');
await testApp.post('/');
// fake timeout of default timeout
clock.tick(DEFAULT_TIMEOUT);
@@ -67,21 +66,18 @@ describe('App', async function () {
});
it('should implement CORS', async function () {
// @ts-ignore
const {headers} = await testApp
.options('/');
// @ts-expect error
const {headers} = await testApp.options('/');
expect(headers['access-control-allow-origin']).to.be.equal('*');
});
it('should provide unsupported media type error in case of a non-json body', async function () {
const responseNoType = await testApp
.post('/non-existing-route')
.send();
const responseNoType = await testApp.post('/non-existing-route').send();
const responseOtherType = await testApp
.post('/non-existing-route')
.set('Content-Type','application/foo')
.set('Content-Type', 'application/foo')
.send();
expect(responseNoType.status).to.equal(new SCUnsupportedMediaTypeErrorResponse().statusCode);