From 66f8919db1ba01d257d10ffeac1005c9e368dddc Mon Sep 17 00:00:00 2001 From: nichlaes Date: Thu, 28 Nov 2024 11:03:47 +0100 Subject: [PATCH] lint fixed --- servers/lib/test/cloudcmd/cloudcmd.spec.ts | 4 ++-- servers/lib/test/e2e/app.e2e.spec.ts | 2 +- .../lib/test/integration/files.service.integration.spec.ts | 4 ++-- servers/lib/test/testUtil.ts | 2 +- servers/lib/test/unit/git-files.service.unit.spec.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/servers/lib/test/cloudcmd/cloudcmd.spec.ts b/servers/lib/test/cloudcmd/cloudcmd.spec.ts index b4532f578..2b65692cb 100644 --- a/servers/lib/test/cloudcmd/cloudcmd.spec.ts +++ b/servers/lib/test/cloudcmd/cloudcmd.spec.ts @@ -7,7 +7,7 @@ describe('cloudcmd test for the application', () => { config(); await writeFile(`${process.env.LOCAL_PATH}/test.txt`, 'content12345'); - // eslint-disable-next-line no-promise-executor-return + await new Promise((resolve) => setTimeout(resolve, 50000)); // This is problematic. }, 55000); @@ -30,7 +30,7 @@ describe('cloudcmd test for the application', () => { expect(fileNames).toContain('user2'); }, 10000); - it('should return the content of a file that is uplaoded to cloudcmd ', async () => { + it('should return the content of a file that is uplaoded to cloudcmd', async () => { const response = await axios.get( `http://localhost:${process.env.PORT}${process.env.APOLLO_PATH}/files/api/v1/fs/test.txt`, ); diff --git a/servers/lib/test/e2e/app.e2e.spec.ts b/servers/lib/test/e2e/app.e2e.spec.ts index cc107d9b9..7a5ceb8cb 100644 --- a/servers/lib/test/e2e/app.e2e.spec.ts +++ b/servers/lib/test/e2e/app.e2e.spec.ts @@ -38,7 +38,7 @@ describe('End to End test for the application', () => { await app.listen(process.env.PORT); // Check if the port is available - // eslint-disable-next-line no-promise-executor-return + while (!app.getHttpServer().listening) { await new Promise((resolve) => setTimeout(resolve, 100)); } diff --git a/servers/lib/test/integration/files.service.integration.spec.ts b/servers/lib/test/integration/files.service.integration.spec.ts index 944b31006..ad301f84e 100644 --- a/servers/lib/test/integration/files.service.integration.spec.ts +++ b/servers/lib/test/integration/files.service.integration.spec.ts @@ -64,9 +64,9 @@ describe('Integration tests for FilesResolver', () => { const modes = ['local']; - // eslint-disable-next-line no-restricted-syntax + for (const mode of modes) { - // eslint-disable-next-line no-loop-func + describe(`when MODE is ${mode}`, () => { beforeEach(() => { jest.spyOn(mockConfigService, 'getMode').mockImplementation(() => mode); diff --git a/servers/lib/test/testUtil.ts b/servers/lib/test/testUtil.ts index 9739b1736..60c673198 100644 --- a/servers/lib/test/testUtil.ts +++ b/servers/lib/test/testUtil.ts @@ -58,7 +58,7 @@ export function sleep(ms) { } export class MockConfigService { - // eslint-disable-next-line class-methods-use-this + getMode(): string { return ''; diff --git a/servers/lib/test/unit/git-files.service.unit.spec.ts b/servers/lib/test/unit/git-files.service.unit.spec.ts index 1612b6f8a..025e4f67f 100644 --- a/servers/lib/test/unit/git-files.service.unit.spec.ts +++ b/servers/lib/test/unit/git-files.service.unit.spec.ts @@ -77,6 +77,6 @@ describe('GitFilesService', () => { await service.readFile('/some/path/file.txt'); // Assert - expect(mockReadFile).toBeCalledTimes(1); + expect(mockReadFile).toHaveBeenCalledTimes(1); }); });