Skip to content

Commit

Permalink
chore(testing-library): replace testing library with testing library …
Browse files Browse the repository at this point in the history
…compass (#6214)

* chore(testing-library): replace all imports; adjust tests when needed; add eslint rule

* chore(testing-library): update package.json with new dep
  • Loading branch information
gribnoysup authored Sep 10, 2024
1 parent bea9599 commit aa6704d
Show file tree
Hide file tree
Showing 230 changed files with 825 additions and 598 deletions.
22 changes: 18 additions & 4 deletions configs/eslint-config-compass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,28 @@ const tsxOverrides = {
rules: { ...tsxRules },
};

const commonTestOverrides = {
'@mongodb-js/compass/unique-mongodb-log-id': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: '@testing-library/*',
message: 'Use @mongodb-js/testing-library-compass instead',
allowTypeImports: false,
},
],
},
],
};

const testJsOverrides = {
...common.testOverrides,
files: ['**/*.spec.js', '**/*.spec.jsx', '**/*.test.js', '**/test/**/*.js'],
rules: {
...common.testRules,
'@mongodb-js/compass/unique-mongodb-log-id': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
...commonTestOverrides,
},
};

Expand All @@ -64,8 +79,7 @@ const testTsOverrides = {
rules: {
...common.testRules,
...extraTsRules,
'@mongodb-js/compass/unique-mongodb-log-id': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
...commonTestOverrides,
},
};

Expand Down
Loading

0 comments on commit aa6704d

Please sign in to comment.