Skip to content

Commit

Permalink
fix missing imports in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davwas committed Jan 15, 2024
1 parent 05278f5 commit 8fb2451
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions apps/server/src/modules/tldraw/repo/tldraw-board.repo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { TldrawWs } from '../controller';
import { MetricsService } from '../metrics';
import { TldrawRepo } from './tldraw.repo';
import { YMongodb } from './y-mongodb';
import { HttpService } from '@nestjs/axios';

Check failure on line 21 in apps/server/src/modules/tldraw/repo/tldraw-board.repo.spec.ts

View workflow job for this annotation

GitHub Actions / nest_lint

`@nestjs/axios` import should occur before import of `../utils/ydoc-utils`

describe('TldrawBoardRepo', () => {
let app: INestApplication;
Expand Down Expand Up @@ -48,6 +49,10 @@ describe('TldrawBoardRepo', () => {
provide: Logger,
useValue: createMock<Logger>(),
},
{
provide: HttpService,
useValue: createMock<HttpService>(),
},
],
}).compile();

Expand Down
5 changes: 5 additions & 0 deletions apps/server/src/modules/tldraw/repo/y-mongodb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { MetricsService } from '../metrics';
import { TldrawBoardRepo } from './tldraw-board.repo';
import { TldrawRepo } from './tldraw.repo';
import { YMongodb } from './y-mongodb';
import { HttpService } from '@nestjs/axios';

Check failure on line 18 in apps/server/src/modules/tldraw/repo/y-mongodb.spec.ts

View workflow job for this annotation

GitHub Actions / nest_lint

`@nestjs/axios` import should occur before import of `../testing`

jest.mock('yjs', () => {
const moduleMock: unknown = {
Expand Down Expand Up @@ -47,6 +48,10 @@ describe('YMongoDb', () => {
provide: Logger,
useValue: createMock<Logger>(),
},
{
provide: HttpService,
useValue: createMock<HttpService>(),
},
],
}).compile();

Expand Down
2 changes: 0 additions & 2 deletions apps/server/src/modules/tldraw/service/tldraw.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ describe('TldrawService', () => {
await repo.create(drawing);
const result = await repo.findByDocName(drawing.docName);
await service.deleteByDocName(drawing.docName);
const emptyResult = await repo.findByDocName(drawing.docName);

expect(result.length).toEqual(1);
expect(emptyResult.length).toEqual(0);
await expect(repo.findByDocName(drawing.docName)).rejects.toThrow(NotFoundException);
});

Expand Down

0 comments on commit 8fb2451

Please sign in to comment.