Skip to content

Commit

Permalink
fixup! chore: update RuleTester config in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Oct 15, 2024
1 parent b9c8d65 commit 859bf27
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/eslint-rules/rules/consistent-callback-type.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { rule, RULE_NAME } from './consistent-callback-type';

const ruleTester = new RuleTester();

global.structuredClone = jest.fn(val => {
return JSON.parse(JSON.stringify(val));
});

ruleTester.run(RULE_NAME, rule, {
valid: [
// Valid when prop is TSTypeAliasDeclaration and the callback uses EventHandler
Expand Down
4 changes: 4 additions & 0 deletions tools/eslint-rules/rules/no-missing-jsx-pragma.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const ruleTester = new RuleTester({
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
});

global.structuredClone = jest.fn(val => {
return JSON.parse(JSON.stringify(val));
});

ruleTester.run(RULE_NAME, rule, {
valid: [
// no slot api used case
Expand Down
4 changes: 4 additions & 0 deletions tools/eslint-rules/rules/no-restricted-globals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { rule, RULE_NAME } from './no-restricted-globals';

const ruleTester = new RuleTester();

global.structuredClone = jest.fn(val => {
return JSON.parse(JSON.stringify(val));
});

ruleTester.run(RULE_NAME, rule, {
valid: [
{
Expand Down

0 comments on commit 859bf27

Please sign in to comment.