diff --git a/.eslintrc.js b/.eslintrc.js index 0d821dc32..08b5558a0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,7 +8,26 @@ module.exports = { project: 'tsconfig.json', sourceType: 'module', }, - plugins: ['@typescript-eslint'], + overrides: [ + { + files: ['test/**', 'src/**/*.spec.ts'], + extends: ['plugin:jest/recommended'], + rules: { + '@typescript-eslint/unbound-method': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/require-await': 'off', + 'jest/unbound-method': 'error', + 'jest/expect-expect': [ + 'error', + { + assertFunctionNames: ['expect', 'request.**.expect'], + }, + ], + }, + }, + ], + plugins: ['@typescript-eslint', 'jest'], extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', diff --git a/package.json b/package.json index dbdeff891..7a3f8cd31 100644 --- a/package.json +++ b/package.json @@ -35,14 +35,15 @@ "@nestjs/typeorm": "7.1.5", "@types/bcrypt": "3.0.1", "@types/cron": "1.7.2", - "@types/node-fetch": "2.5.10", "@types/minio": "7.0.7", + "@types/node-fetch": "2.5.10", "@types/passport-http-bearer": "1.0.36", "bcrypt": "5.0.1", "class-transformer": "0.4.0", "class-validator": "0.13.1", "cli-color": "2.0.0", "connect-typeorm": "1.1.4", + "eslint-plugin-jest": "^24.3.5", "file-type": "16.3.0", "joi": "17.4.0", "minio": "7.0.18", diff --git a/src/auth/auth.service.spec.ts b/src/auth/auth.service.spec.ts index 0aaa41ae3..f8e138035 100644 --- a/src/auth/auth.service.spec.ts +++ b/src/auth/auth.service.spec.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-call, -@typescript-eslint/no-unsafe-member-access, -@typescript-eslint/no-unsafe-return, -@typescript-eslint/require-await */ - import { Test, TestingModule } from '@nestjs/testing'; import { AuthService } from './auth.service'; import { PassportModule } from '@nestjs/passport'; @@ -70,17 +64,17 @@ describe('AuthService', () => { it('works', async () => { const testPassword = 'thisIsATestPassword'; const hash = await service.hashPassword(testPassword); - void service + await service .checkPassword(testPassword, hash) .then((result) => expect(result).toBeTruthy()); }); it('fails, if secret is too short', async () => { const secret = service.bufferToBase64Url(service.randomString(54)); const hash = await service.hashPassword(secret); - void service + await service .checkPassword(secret, hash) .then((result) => expect(result).toBeTruthy()); - void service + await service .checkPassword(secret.substr(0, secret.length - 1), hash) .then((result) => expect(result).toBeFalsy()); }); @@ -119,11 +113,9 @@ describe('AuthService', () => { describe('fails:', () => { it('AuthToken could not be found', async () => { jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.getAuthTokenAndValidate(authToken.keyId, token); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect( + service.getAuthTokenAndValidate(authToken.keyId, token), + ).rejects.toThrow(NotInDBError); }); it('AuthToken has wrong hash', async () => { jest.spyOn(authTokenRepo, 'findOne').mockResolvedValueOnce({ @@ -131,11 +123,9 @@ describe('AuthService', () => { user: user, accessTokenHash: 'the wrong hash', }); - try { - await service.getAuthTokenAndValidate(authToken.keyId, token); - } catch (e) { - expect(e).toBeInstanceOf(TokenNotValidError); - } + await expect( + service.getAuthTokenAndValidate(authToken.keyId, token), + ).rejects.toThrow(TokenNotValidError); }); it('AuthToken has wrong validUntil Date', async () => { const accessTokenHash = await service.hashPassword(token); @@ -145,11 +135,9 @@ describe('AuthService', () => { accessTokenHash: accessTokenHash, validUntil: new Date(1549312452000), }); - try { - await service.getAuthTokenAndValidate(authToken.keyId, token); - } catch (e) { - expect(e).toBeInstanceOf(TokenNotValidError); - } + await expect( + service.getAuthTokenAndValidate(authToken.keyId, token), + ).rejects.toThrow(TokenNotValidError); }); }); }); @@ -161,13 +149,13 @@ describe('AuthService', () => { user: user, lastUsed: new Date(1549312452000), }); - jest - .spyOn(authTokenRepo, 'save') - .mockImplementationOnce(async (authTokenSaved, _) => { + jest.spyOn(authTokenRepo, 'save').mockImplementationOnce( + async (authTokenSaved, _): Promise => { expect(authTokenSaved.keyId).toEqual(authToken.keyId); expect(authTokenSaved.lastUsed).not.toEqual(1549312452000); return authToken; - }); + }, + ); await service.setLastUsedToken(authToken.keyId); }); }); @@ -185,11 +173,11 @@ describe('AuthService', () => { user: user, accessTokenHash: accessTokenHash, }); - jest - .spyOn(authTokenRepo, 'save') - .mockImplementationOnce(async (_, __) => { + jest.spyOn(authTokenRepo, 'save').mockImplementationOnce( + async (_, __): Promise => { return authToken; - }); + }, + ); const userByToken = await service.validateToken( `${authToken.keyId}.${token}`, ); @@ -199,15 +187,15 @@ describe('AuthService', () => { }); }); describe('fails:', () => { - it('the secret is missing', () => { - void expect( + it('the secret is missing', async () => { + await expect( service.validateToken(`${authToken.keyId}`), - ).rejects.toBeInstanceOf(TokenNotValidError); + ).rejects.toThrow(TokenNotValidError); }); - it('the secret is too long', () => { - void expect( + it('the secret is too long', async () => { + await expect( service.validateToken(`${authToken.keyId}.${'a'.repeat(73)}`), - ).rejects.toBeInstanceOf(TokenNotValidError); + ).rejects.toThrow(TokenNotValidError); }); }); }); @@ -218,15 +206,15 @@ describe('AuthService', () => { ...authToken, user: user, }); - jest - .spyOn(authTokenRepo, 'remove') - .mockImplementationOnce(async (token, __) => { + jest.spyOn(authTokenRepo, 'remove').mockImplementationOnce( + async (token, __): Promise => { expect(token).toEqual({ ...authToken, user: user, }); return authToken; - }); + }, + ); await service.removeToken(authToken.keyId); }); }); @@ -239,12 +227,12 @@ describe('AuthService', () => { ...user, authTokens: [authToken], }); - jest - .spyOn(authTokenRepo, 'save') - .mockImplementationOnce(async (authTokenSaved: AuthToken, _) => { + jest.spyOn(authTokenRepo, 'save').mockImplementationOnce( + async (authTokenSaved: AuthToken, _): Promise => { expect(authTokenSaved.lastUsed).toBeUndefined(); return authTokenSaved; - }); + }, + ); const token = await service.createTokenForUser( user.userName, identifier, @@ -263,12 +251,12 @@ describe('AuthService', () => { ...user, authTokens: [authToken], }); - jest - .spyOn(authTokenRepo, 'save') - .mockImplementationOnce(async (authTokenSaved: AuthToken, _) => { + jest.spyOn(authTokenRepo, 'save').mockImplementationOnce( + async (authTokenSaved: AuthToken, _): Promise => { expect(authTokenSaved.lastUsed).toBeUndefined(); return authTokenSaved; - }); + }, + ); const validUntil = new Date().getTime() + 30000; const token = await service.createTokenForUser( user.userName, @@ -294,7 +282,7 @@ describe('AuthService', () => { }); describe('toAuthTokenDto', () => { - it('works', async () => { + it('works', () => { const authToken = new AuthToken(); authToken.keyId = 'testKeyId'; authToken.label = 'testLabel'; diff --git a/src/config/utils.spec.ts b/src/config/utils.spec.ts index 72d5196a5..30f21d34e 100644 --- a/src/config/utils.spec.ts +++ b/src/config/utils.spec.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-call, -@typescript-eslint/no-unsafe-member-access, -@typescript-eslint/no-unsafe-return, -@typescript-eslint/require-await */ - import { replaceAuthErrorsWithEnvironmentVariables, toArrayConfig, @@ -34,7 +28,7 @@ describe('config utils', () => { ]); }); }); - describe('toArrayConfig', () => { + describe('replaceAuthErrorsWithEnvironmentVariables', () => { it('"gitlab[0].scope', () => { expect( replaceAuthErrorsWithEnvironmentVariables( diff --git a/src/frontend-config/frontend-config.service.spec.ts b/src/frontend-config/frontend-config.service.spec.ts index 117547709..d2e90a7e0 100644 --- a/src/frontend-config/frontend-config.service.spec.ts +++ b/src/frontend-config/frontend-config.service.spec.ts @@ -16,6 +16,10 @@ import { AppConfig } from '../config/app.config'; import { ExternalServicesConfig } from '../config/external-services.config'; import { Loglevel } from '../config/loglevel.enum'; +/* eslint-disable + jest/no-conditional-expect + */ + describe('FrontendConfigService', () => { const emptyAuthConfig: AuthConfig = { email: { diff --git a/src/groups/groups.service.spec.ts b/src/groups/groups.service.spec.ts index 840fd2029..1113b4c8b 100644 --- a/src/groups/groups.service.spec.ts +++ b/src/groups/groups.service.spec.ts @@ -48,11 +48,9 @@ describe('GroupsService', () => { }); it('fails with non-existing group', async () => { jest.spyOn(groupRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.getGroupByName('i_dont_exist'); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect(service.getGroupByName('i_dont_exist')).rejects.toThrow( + NotInDBError, + ); }); }); diff --git a/src/history/history.service.spec.ts b/src/history/history.service.spec.ts index 985215f99..b41361c86 100644 --- a/src/history/history.service.spec.ts +++ b/src/history/history.service.spec.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-call, -@typescript-eslint/no-unsafe-member-access, -@typescript-eslint/no-unsafe-return, -@typescript-eslint/require-await */ - import { Test, TestingModule } from '@nestjs/testing'; import { LoggerModule } from '../logger/logger.module'; import { HistoryService } from './history.service'; @@ -138,11 +132,9 @@ describe('HistoryService', () => { describe('fails', () => { it('with an non-existing note', async () => { jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.getEntryByNoteIdOrAlias(alias, {} as User); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect( + service.getEntryByNoteIdOrAlias(alias, {} as User), + ).rejects.toThrow(NotInDBError); }); }); }); @@ -229,13 +221,11 @@ describe('HistoryService', () => { const note = Note.create(user, alias); jest.spyOn(historyRepo, 'findOne').mockResolvedValueOnce(undefined); jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(note); - try { - await service.updateHistoryEntry(alias, user, { + await expect( + service.updateHistoryEntry(alias, user, { pinStatus: true, - }); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + }), + ).rejects.toThrow(NotInDBError); }); }); }); @@ -282,6 +272,7 @@ describe('HistoryService', () => { it('without an entry', async () => { jest.spyOn(historyRepo, 'find').mockResolvedValueOnce([]); await service.deleteHistory(user); + expect(true).toBeTruthy(); }); }); }); @@ -311,19 +302,15 @@ describe('HistoryService', () => { const note = Note.create(user, alias); jest.spyOn(historyRepo, 'findOne').mockResolvedValueOnce(undefined); jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(note); - try { - await service.deleteHistoryEntry(alias, user); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect(service.deleteHistoryEntry(alias, user)).rejects.toThrow( + NotInDBError, + ); }); it('without a note', async () => { jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.getEntryByNoteIdOrAlias(alias, {} as User); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect( + service.getEntryByNoteIdOrAlias(alias, {} as User), + ).rejects.toThrow(NotInDBError); }); }); }); diff --git a/src/media/media.service.spec.ts b/src/media/media.service.spec.ts index 13197b078..9ee8481ab 100644 --- a/src/media/media.service.spec.ts +++ b/src/media/media.service.spec.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-call, -@typescript-eslint/no-unsafe-member-access, -@typescript-eslint/no-unsafe-return, -@typescript-eslint/require-await */ - import { ConfigModule } from '@nestjs/config'; import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; @@ -135,24 +129,16 @@ describe('MediaService', () => { describe('fails:', () => { it('MIME type not identifiable', async () => { - try { - await service.saveFile(Buffer.alloc(1), 'hardcoded', 'test'); - } catch (e) { - expect(e).toBeInstanceOf(ClientError); - expect(e.message).toContain('detect'); - } + await expect( + service.saveFile(Buffer.alloc(1), 'hardcoded', 'test'), + ).rejects.toThrow(ClientError); }); it('MIME type not supported', async () => { - try { - const testText = await fs.readFile( - 'test/public-api/fixtures/test.zip', - ); - await service.saveFile(testText, 'hardcoded', 'test'); - } catch (e) { - expect(e).toBeInstanceOf(ClientError); - expect(e.message).not.toContain('detect'); - } + const testText = await fs.readFile('test/public-api/fixtures/test.zip'); + await expect( + service.saveFile(testText, 'hardcoded', 'test'), + ).rejects.toThrow(ClientError); }); }); }); @@ -197,36 +183,36 @@ describe('MediaService', () => { jest .spyOn(mediaRepo, 'findOne') .mockResolvedValueOnce(mockMediaUploadEntry); - try { - await service.deleteFile(testFileName, 'hardcoded'); - } catch (e) { - expect(e).toBeInstanceOf(PermissionError); - } + await expect( + service.deleteFile(testFileName, 'hardcoded'), + ).rejects.toThrow(PermissionError); }); }); describe('findUploadByFilename', () => { it('works', async () => { const testFileName = 'testFilename'; + const userName = 'hardcoded'; + const backendData = 'testBackendData'; const mockMediaUploadEntry = { id: 'testMediaUpload', - backendData: 'testBackendData', + backendData: backendData, user: { - userName: 'hardcoded', + userName: userName, } as User, } as MediaUpload; jest .spyOn(mediaRepo, 'findOne') .mockResolvedValueOnce(mockMediaUploadEntry); - await service.findUploadByFilename(testFileName); + const mediaUpload = await service.findUploadByFilename(testFileName); + expect(mediaUpload.user.userName).toEqual(userName); + expect(mediaUpload.backendData).toEqual(backendData); }); it("fails: can't find mediaUpload", async () => { const testFileName = 'testFilename'; jest.spyOn(mediaRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.findUploadByFilename(testFileName); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect(service.findUploadByFilename(testFileName)).rejects.toThrow( + NotInDBError, + ); }); }); diff --git a/src/notes/notes.service.spec.ts b/src/notes/notes.service.spec.ts index edae9cd84..7192b5d96 100644 --- a/src/notes/notes.service.spec.ts +++ b/src/notes/notes.service.spec.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable @typescript-eslint/require-await */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; import { LoggerModule } from '../logger/logger.module'; @@ -202,22 +196,18 @@ describe('NotesService', () => { }); describe('fails:', () => { it('alias is forbidden', async () => { - try { - await service.createNote(content, forbiddenNoteId); - } catch (e) { - expect(e).toBeInstanceOf(ForbiddenIdError); - } + await expect( + service.createNote(content, forbiddenNoteId), + ).rejects.toThrow(ForbiddenIdError); }); it('alias is already used', async () => { jest.spyOn(noteRepo, 'save').mockImplementationOnce(async () => { throw new Error(); }); - try { - await service.createNote(content, alias); - } catch (e) { - expect(e).toBeInstanceOf(AlreadyInDBError); - } + await expect(service.createNote(content, alias)).rejects.toThrow( + AlreadyInDBError, + ); }); }); }); @@ -231,7 +221,7 @@ describe('NotesService', () => { const newNote = await service.createNote(content); const revisions = await newNote.revisions; jest.spyOn(revisionRepo, 'findOne').mockResolvedValueOnce(revisions[0]); - void service.getNoteContent(newNote).then((result) => { + await service.getNoteContent(newNote).then((result) => { expect(result).toEqual(content); }); }); @@ -246,7 +236,7 @@ describe('NotesService', () => { const newNote = await service.createNote(content); const revisions = await newNote.revisions; jest.spyOn(revisionRepo, 'findOne').mockResolvedValueOnce(revisions[0]); - void service.getLatestRevision(newNote).then((result) => { + await service.getLatestRevision(newNote).then((result) => { expect(result).toEqual(revisions[0]); }); }); @@ -263,7 +253,7 @@ describe('NotesService', () => { const newNote = await service.createNote(content); const revisions = await newNote.revisions; jest.spyOn(revisionRepo, 'findOne').mockResolvedValueOnce(revisions[0]); - void service.getLatestRevision(newNote).then((result) => { + await service.getLatestRevision(newNote).then((result) => { expect(result).toEqual(revisions[0]); }); }); @@ -280,19 +270,15 @@ describe('NotesService', () => { describe('fails:', () => { it('no note found', async () => { jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.getNoteByIdOrAlias('noteThatDoesNoteExist'); - } catch (e) { - expect(e).toBeInstanceOf(NotInDBError); - } + await expect( + service.getNoteByIdOrAlias('noteThatDoesNoteExist'), + ).rejects.toThrow(NotInDBError); }); it('id is forbidden', async () => { jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(undefined); - try { - await service.getNoteByIdOrAlias(forbiddenNoteId); - } catch (e) { - expect(e).toBeInstanceOf(ForbiddenIdError); - } + await expect( + service.getNoteByIdOrAlias(forbiddenNoteId), + ).rejects.toThrow(ForbiddenIdError); }); }); }); @@ -593,36 +579,30 @@ describe('NotesService', () => { }); describe('fails:', () => { it('userPermissions has duplicate entries', async () => { - try { - await service.updateNotePermissions(note, { + await expect( + service.updateNotePermissions(note, { sharedToUsers: [userPermissionUpdate, userPermissionUpdate], sharedToGroups: [], - }); - } catch (e) { - expect(e).toBeInstanceOf(PermissionsUpdateInconsistentError); - } + }), + ).rejects.toThrow(PermissionsUpdateInconsistentError); }); it('groupPermissions has duplicate entries', async () => { - try { - await service.updateNotePermissions(note, { + await expect( + service.updateNotePermissions(note, { sharedToUsers: [], sharedToGroups: [groupPermissionUpate, groupPermissionUpate], - }); - } catch (e) { - expect(e).toBeInstanceOf(PermissionsUpdateInconsistentError); - } + }), + ).rejects.toThrow(PermissionsUpdateInconsistentError); }); it('userPermissions and groupPermissions have duplicate entries', async () => { - try { - await service.updateNotePermissions(note, { + await expect( + service.updateNotePermissions(note, { sharedToUsers: [userPermissionUpdate, userPermissionUpdate], sharedToGroups: [groupPermissionUpate, groupPermissionUpate], - }); - } catch (e) { - expect(e).toBeInstanceOf(PermissionsUpdateInconsistentError); - } + }), + ).rejects.toThrow(PermissionsUpdateInconsistentError); }); }); }); diff --git a/src/permissions/permissions.service.spec.ts b/src/permissions/permissions.service.spec.ts index d6861c5ff..f9fabf46f 100644 --- a/src/permissions/permissions.service.spec.ts +++ b/src/permissions/permissions.service.spec.ts @@ -4,12 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-call, -@typescript-eslint/no-unsafe-member-access, -@typescript-eslint/no-unsafe-return, -@typescript-eslint/require-await */ - import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; import { AuthToken } from '../auth/auth-token.entity'; @@ -425,13 +419,13 @@ describe('PermissionsService', () => { function permutator( inputArr: NoteGroupPermission[], ): NoteGroupPermission[][] { - const results = []; + const results: NoteGroupPermission[][] = []; function permute( arr: NoteGroupPermission[], memo: NoteGroupPermission[], ): NoteGroupPermission[][] { - let cur; + let cur: NoteGroupPermission[]; for (let i = 0; i < arr.length; i++) { cur = arr.splice(i, 1); diff --git a/test/private-api/history.e2e-spec.ts b/test/private-api/history.e2e-spec.ts index c7c81f2dd..74aee331a 100644 --- a/test/private-api/history.e2e-spec.ts +++ b/test/private-api/history.e2e-spec.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { INestApplication } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { Test } from '@nestjs/testing'; diff --git a/test/private-api/media.e2e-spec.ts b/test/private-api/media.e2e-spec.ts index c6c6e17ce..a7da82323 100644 --- a/test/private-api/media.e2e-spec.ts +++ b/test/private-api/media.e2e-spec.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { ConfigModule, ConfigService } from '@nestjs/config'; import { NestExpressApplication } from '@nestjs/platform-express'; import { Test } from '@nestjs/testing'; diff --git a/test/private-api/notes.e2e-spec.ts b/test/private-api/notes.e2e-spec.ts index 0b6b8f6f0..e8fc2fa3c 100644 --- a/test/private-api/notes.e2e-spec.ts +++ b/test/private-api/notes.e2e-spec.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { INestApplication } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { Test } from '@nestjs/testing'; diff --git a/test/public-api/me.e2e-spec.ts b/test/public-api/me.e2e-spec.ts index 76a3161c9..62d8e6413 100644 --- a/test/public-api/me.e2e-spec.ts +++ b/test/public-api/me.e2e-spec.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import * as request from 'supertest'; diff --git a/test/public-api/media.e2e-spec.ts b/test/public-api/media.e2e-spec.ts index 9ae4379d8..7e21216f2 100644 --- a/test/public-api/media.e2e-spec.ts +++ b/test/public-api/media.e2e-spec.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { ConfigModule, ConfigService } from '@nestjs/config'; import { NestExpressApplication } from '@nestjs/platform-express'; import { Test } from '@nestjs/testing'; diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index b7f2e2e2c..dcabd4dd5 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -4,11 +4,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/* eslint-disable -@typescript-eslint/no-unsafe-assignment, -@typescript-eslint/no-unsafe-member-access -*/ - import { INestApplication } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { Test } from '@nestjs/testing'; diff --git a/yarn.lock b/yarn.lock index f26a97574..6a645b019 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1309,7 +1309,7 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.22.0": +"@typescript-eslint/experimental-utils@4.22.0", "@typescript-eslint/experimental-utils@^4.0.1": version "4.22.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz#68765167cca531178e7b650a53456e6e0bef3b1f" integrity sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg== @@ -2940,6 +2940,13 @@ eslint-plugin-import@2.22.1: resolve "^1.17.0" tsconfig-paths "^3.9.0" +eslint-plugin-jest@^24.3.5: + version "24.3.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.5.tgz#71f0b580f87915695c286c3f0eb88cf23664d044" + integrity sha512-XG4rtxYDuJykuqhsOqokYIR84/C8pRihRtEpVskYLbIIKGwPNW2ySxdctuVzETZE+MbF/e7wmsnbNVpzM0rDug== + dependencies: + "@typescript-eslint/experimental-utils" "^4.0.1" + eslint-scope@^5.0.0, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"