Skip to content

Commit

Permalink
fix(no-await-sync-events): define option schema correctly (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
Belco90 committed Apr 12, 2022
1 parent 88f6735 commit 59ee30d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/rules/no-await-sync-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default createTestingLibraryRule<Options, MessageIds>({
type: 'object',
properties: {
eventModules: {
enum: VALID_EVENT_MODULES,
type: 'array',
minItems: 1,
items: {
enum: VALID_EVENT_MODULES,
},
},
},
additionalProperties: false,
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/rules/no-await-sync-events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ ruleTester.run(RULE_NAME, rule, {
await fireEvent.${func}('foo');
});
`,
options: [{ eventModules: 'user-event' }],
options: [{ eventModules: ['user-event'] }],
})),

// valid tests for user-event when only fire-event set in eventModules
Expand All @@ -186,7 +186,7 @@ ruleTester.run(RULE_NAME, rule, {
await userEvent.${func}('foo');
});
`,
options: [{ eventModules: 'fire-event' }],
options: [{ eventModules: ['fire-event'] }],
})),
],

Expand Down Expand Up @@ -243,7 +243,7 @@ ruleTester.run(RULE_NAME, rule, {
await fireEvent.${func}('foo');
});
`,
options: [{ eventModules: 'fire-event' }],
options: [{ eventModules: ['fire-event'] }],
errors: [
{
line: 4,
Expand All @@ -265,7 +265,7 @@ ruleTester.run(RULE_NAME, rule, {
await userEvent.${func}('foo');
});
`,
options: [{ eventModules: 'user-event' }],
options: [{ eventModules: ['user-event'] }],
errors: [
{
line: 4,
Expand Down

0 comments on commit 59ee30d

Please sign in to comment.