Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match exact blocks by default, allow prefix matching with the use of a * in the block options #35

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

levibuzolic
Copy link
Owner

@levibuzolic levibuzolic commented Jul 21, 2022

Previously blocks were matched by prefix, meaning testResource.only would trigger an error when trying to match for blocks of test. In coms cases this could be too noisy, especially when using libraries that may include a .only method as any of the default configured blocks ('describe', 'it', 'context', 'test', 'tape', 'fixture', 'serial') could match.

This PR removes that behaviour by default and allows it to be optionally configured by specify blocks with a trailing asterisk (ie. test* to opt into the old behaviour).

Fixes #33

@github-actions
Copy link

github-actions bot commented Jul 21, 2022

📊 Package size report   6%↑

File Before After
README.md 3.1 kB 3%↑3.2 kB
rules/no-only-tests.js 2.4 kB 16%↑2.8 kB
Total (Includes all files) 7.4 kB 6%↑7.9 kB
Tarball size 3.3 kB 5%↑3.4 kB
Unchanged files
File Size
index.js 106 B
LICENSE 1.1 kB
package.json 807 B

🤖 This report was automatically generated by pkg-size-action

@levibuzolic levibuzolic force-pushed the wildcard-block-matchers branch 2 times, most recently from f25c5a7 to e760604 Compare July 21, 2022 07:34
@levibuzolic levibuzolic changed the title [WIP] Match exact blocks by default, allow prefix matching with the use of a * in the block options Jul 21, 2022
@levibuzolic levibuzolic force-pushed the wildcard-block-matchers branch from e760604 to 11bd494 Compare July 21, 2022 07:39
@levibuzolic levibuzolic marked this pull request as ready for review July 21, 2022 07:51
@levibuzolic levibuzolic merged commit 929d64a into master Jul 21, 2022
@levibuzolic levibuzolic deleted the wildcard-block-matchers branch July 21, 2022 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Matches blocks that are prefixed with any of the given blocks.
1 participant