feat(server): add model base (#9734)

This commit is contained in:
forehalo
2025-01-17 02:03:53 +00:00
parent c2149f218b
commit 64335b9e0c
12 changed files with 105 additions and 65 deletions

View File

@@ -13,9 +13,7 @@ interface Context {
const test = ava as TestFn<Context>;
test.before(async t => {
const module = await createTestingModule({
providers: [FeatureModel],
});
const module = await createTestingModule({});
t.context.feature = module.get(FeatureModel);
t.context.module = module;

View File

@@ -18,9 +18,7 @@ interface Context {
const test = ava as TestFn<Context>;
test.before(async t => {
const module = await createTestingModule({
providers: [SessionModel],
});
const module = await createTestingModule({});
t.context.session = module.get(SessionModel);
t.context.user = module.get(UserModel);

View File

@@ -17,9 +17,7 @@ interface Context {
const test = ava as TestFn<Context>;
test.before(async t => {
const module = await createTestingModule({
providers: [UserModel],
});
const module = await createTestingModule({});
t.context.user = module.get(UserModel);
t.context.module = module;

View File

@@ -17,9 +17,7 @@ interface Context {
const test = ava as TestFn<Context>;
test.before(async t => {
const module = await createTestingModule({
providers: [VerificationTokenModel],
});
const module = await createTestingModule({});
t.context.verificationToken = module.get(VerificationTokenModel);
t.context.db = module.get(PrismaClient);