Skip to content

Commit e332173

Browse files
feat: add support for @marko/testing-library (#572)
* feat: add support for @marko/testing-library * feat: add tests and update documentation for @marko/testing-library * fix: run prettier and update readme * test: add tests for @marko/testing-library * test: add marko tests for await-async-query-test * chore: address review comment * test: add marko await fire-event test case * test: add test for no-await-sync-query * test: no container * test: no-debugging-utils * test: no-dom-import * test: no-node-access * test: no unnecassary act * test: no-wait-for-empty-callback * test: no-wait-for-multiple-assertions * test: no-wait-for-side-effects * test: prefer-query-by-disappearance * test: prefer-screen-queries * test: render-result-naming-convention * fix: update no-dom-import rule to report the right module name * fix: address PR comments * fix: update Marko's brand logo
1 parent 6148c6b commit e332173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+749
-177
lines changed

README.md

Lines changed: 45 additions & 31 deletions
Large diffs are not rendered by default.

docs/rules/await-fire-event.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ methods.
1212
>
1313
> - `@testing-library/vue` (supported by this plugin)
1414
> - `@testing-library/svelte` (not supported yet by this plugin)
15+
> - `@marko/testing-library` (supported by this plugin)
1516
1617
Examples of **incorrect** code for this rule:
1718

docs/rules/no-dom-import.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ With the configuration above, if the user imports from `@testing-library/dom` or
7676
- [Angular Testing Library API](https://testing-library.com/docs/angular-testing-library/api)
7777
- [React Testing Library API](https://testing-library.com/docs/react-testing-library/api)
7878
- [Vue Testing Library API](https://testing-library.com/docs/vue-testing-library/api)
79+
- [Marko Testing Library API](https://testing-library.com/docs/marko-testing-library/api)

docs/rules/no-unnecessary-act.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
> - `@testing-library/react` (supported by this plugin)
66
> - `@testing-library/preact` (not supported yet by this plugin)
77
> - `@testing-library/svelte` (not supported yet by this plugin)
8+
> - `@marko/testing-library` (supported by this plugin)
89
910
## Rule Details
1011

lib/configs/marko.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// THIS CODE WAS AUTOMATICALLY GENERATED
2+
// DO NOT EDIT THIS CODE BY HAND
3+
// YOU CAN REGENERATE IT USING npm run generate:configs
4+
5+
export = {
6+
plugins: ['testing-library'],
7+
rules: {
8+
'testing-library/await-async-query': 'error',
9+
'testing-library/await-async-utils': 'error',
10+
'testing-library/await-fire-event': 'error',
11+
'testing-library/no-await-sync-query': 'error',
12+
'testing-library/no-container': 'error',
13+
'testing-library/no-debugging-utils': 'error',
14+
'testing-library/no-dom-import': ['error', 'marko'],
15+
'testing-library/no-node-access': 'error',
16+
'testing-library/no-promise-in-fire-event': 'error',
17+
'testing-library/no-render-in-setup': 'error',
18+
'testing-library/no-unnecessary-act': 'error',
19+
'testing-library/no-wait-for-empty-callback': 'error',
20+
'testing-library/no-wait-for-multiple-assertions': 'error',
21+
'testing-library/no-wait-for-side-effects': 'error',
22+
'testing-library/no-wait-for-snapshot': 'error',
23+
'testing-library/prefer-find-by': 'error',
24+
'testing-library/prefer-presence-queries': 'error',
25+
'testing-library/prefer-query-by-disappearance': 'error',
26+
'testing-library/prefer-screen-queries': 'error',
27+
'testing-library/render-result-naming-convention': 'error',
28+
},
29+
};

lib/rules/await-async-query.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default createTestingLibraryRule<Options, MessageIds>({
2525
angular: 'error',
2626
react: 'error',
2727
vue: 'error',
28+
marko: 'error',
2829
},
2930
},
3031
messages: {

lib/rules/await-async-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default createTestingLibraryRule<Options, MessageIds>({
2424
angular: 'error',
2525
react: 'error',
2626
vue: 'error',
27+
marko: 'error',
2728
},
2829
},
2930
messages: {

lib/rules/await-fire-event.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default createTestingLibraryRule<Options, MessageIds>({
2424
angular: false,
2525
react: false,
2626
vue: 'error',
27+
marko: 'error',
2728
},
2829
},
2930
messages: {

lib/rules/consistent-data-testid.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default createTestingLibraryRule<Options, MessageIds>({
2323
angular: false,
2424
react: false,
2525
vue: false,
26+
marko: false,
2627
},
2728
},
2829
messages: {

lib/rules/no-await-sync-events.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default createTestingLibraryRule<Options, MessageIds>({
2929
angular: false,
3030
react: false,
3131
vue: false,
32+
marko: false,
3233
},
3334
},
3435
messages: {

0 commit comments

Comments
 (0)