Skip to content

Commit

Permalink
Add one more test for array test
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel7grant committed Aug 5, 2024
1 parent 92b905c commit 7a74ad3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/rules/enforce-column-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ ruleTester.run('enforce-column-types', enforceColumnTypes, {
}`,
},
{
name: 'should ignore unknown types',
name: 'should allow unknown types',
code: `class Entity {
@Column({ type: 'json' })
unknownField: unknown;
}`,
},
{
name: 'should ignore unknown array types',
name: 'should allow unknown array types',
code: `class Entity {
@Column({ type: 'json' })
unknownArray: unknown[];
Expand All @@ -188,6 +188,14 @@ ruleTester.run('enforce-column-types', enforceColumnTypes, {
referenceNullable: JsonObject | null;
}`,
},
{
name: 'should allow reference array types',
code: `type JsonObject = {};
class Entity {
@Column({ type: 'jsonb' })
referenceArray: JsonObject[];
}`,
},
{
name: 'should ignore transformed types',
code: `class Entity {
Expand Down

0 comments on commit 7a74ad3

Please sign in to comment.