Skip to content

Commit 3f46b81

Browse files
committed
test: Fix unit test
1 parent ff0ab8d commit 3f46b81

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/test/generate.spec.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,13 +1442,13 @@ describe('hide field', () => {
14421442
});
14431443

14441444
it('check files', () => {
1445-
[
1445+
for (const file of [
14461446
'user-group-by.output.ts',
14471447
'user-max-aggregate.output.ts',
14481448
'user-min-aggregate.output.ts',
14491449
'user-create-many.input.ts',
14501450
'user.model.ts',
1451-
].forEach(file => {
1451+
]) {
14521452
const s = testSourceFile({
14531453
project,
14541454
file,
@@ -1462,7 +1462,7 @@ describe('hide field', () => {
14621462
expect(s.propertyDecorators).toContainEqual(
14631463
expect.objectContaining({ name: 'HideField' }),
14641464
);
1465-
});
1465+
}
14661466
});
14671467
});
14681468
});
@@ -2287,8 +2287,12 @@ describe('non list optional properties should be nullable', () => {
22872287
});
22882288

22892289
it('user model count', () => {
2290-
setSourceFile('user.model.ts');
2291-
expect(p('_count')?.type).toEqual('UserCount | null');
2290+
const s = testSourceFile({
2291+
project,
2292+
file: 'user.model.ts',
2293+
property: '_count',
2294+
});
2295+
expect(s.property?.type).toEqual('UserCount');
22922296
});
22932297

22942298
it('article model author', () => {

0 commit comments

Comments
 (0)