fix(testing): update test regex for 'e2e.ts' #3277
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm test
) were run locally and passednpm run test.karma.prod
) were run locally and passednpm run prettier
) was run locally and passedPull request type
Please check the type of change your PR introduces:
What is the current behavior?
c6fda39 created a regression where files named
e2e.ts
would not be picked up correctly by the test runnerGitHub Issue Number: #3275
What is the new behavior?
this commit fixes an edge case where unit tests were not being properly
detected following c6fda39
the ionic framework has tests named
e2e.ts
that we must account for inthis regex. because jest doesn't error when no tests are found, we
missed this in the original implementation.
tests of name 'spec.ts' and 'test.ts' (or any other acceptable
extension) are considered unit tests, and tests of the name 'e2e.ts' are
considered end-to-end tests
Does this introduce a breaking change?
Testing
I pulled this branch, built this branch, and generated a tarball:
npm ci && npm run build && npm pack
Within Ionic Core, I installed my tarball in
ionic-framework/core
and ran two tests:npm run test src/components/modal/test/basic
to verify tests are runnpm t -- --no-cache
:I then installed Stencil v2.14.0 (prior to the regression) and ran the entire test suite to verify the counts aligned:
(this doesn't to a test-for-test comparison, but it does give us a high degree of confidence that the fix works when the first test case is taken into account).
I finally installed Stencil v2.14.1 (which has the regression) to observe some tests are omitted:
Other information
Related to #3276, but at the time of this writing am not 100% sure
this solves the that issue