Skip to content

Commit 43290d7

Browse files
committed
test: avoid reusing synced constants in tests; use hardcoded values to prevent silent failures
1 parent b6b14fe commit 43290d7

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

tests/lib/utils/is-testing-library-module.test.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1-
import {
2-
LIBRARY_MODULES,
3-
OLD_LIBRARY_MODULES,
4-
USER_EVENT_MODULE,
5-
} from '../../../lib/utils';
61
import {
72
isCustomTestingLibraryModule,
83
isOfficialTestingLibraryModule,
94
isTestingLibraryModule,
105
} from '../../../lib/utils/is-testing-library-module';
116

7+
const OLD_LIBRARY_MODULES = [
8+
'dom-testing-library',
9+
'vue-testing-library',
10+
'react-testing-library',
11+
] as const;
12+
13+
const LIBRARY_MODULES = [
14+
'@testing-library/dom',
15+
'@testing-library/angular',
16+
'@testing-library/react',
17+
'@testing-library/preact',
18+
'@testing-library/vue',
19+
'@testing-library/svelte',
20+
'@marko/testing-library',
21+
] as const;
22+
23+
const USER_EVENT_MODULE = '@testing-library/user-event';
24+
1225
describe('isOfficialTestingLibraryModule', () => {
1326
it.each([...OLD_LIBRARY_MODULES, ...LIBRARY_MODULES, USER_EVENT_MODULE])(
1427
'returns true when arg is "%s"',

0 commit comments

Comments
 (0)