Skip to content

Commit 778ae12

Browse files
authored
Merge pull request #24 from DouglasNeuroInformatics/dev
test: add test for InjectPrismaClient
2 parents 7294ab0 + 1109303 commit 778ae12

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/modules/prisma/__tests__/prisma.decorators.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, expect, it, vi } from 'vitest';
22

3-
import { InjectModel } from '../prisma.decorators.js';
3+
import { PRISMA_CLIENT_TOKEN } from '../prisma.config.js';
4+
import { InjectModel, InjectPrismaClient } from '../prisma.decorators.js';
45

56
import type { PrismaModelName } from '../prisma.types.js';
67

@@ -20,3 +21,11 @@ describe('InjectModel', () => {
2021
expect(model).toBe('INJECTED');
2122
});
2223
});
24+
25+
describe('InjectPrismaClient', () => {
26+
it('should call Inject with the correct token', () => {
27+
const model = InjectPrismaClient();
28+
expect(Inject).toHaveBeenCalledWith(PRISMA_CLIENT_TOKEN);
29+
expect(model).toBe('INJECTED');
30+
});
31+
});

0 commit comments

Comments
 (0)