-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): pass jest args correctly for v28/29 (#5068)
the original goal of this effort was to remove the `any` type on `jest-apt.ts`'s `JestTestRunner` type. doing so revealed a handful of subtle errors in the implementation of the jest runner for stencil. 1. `jest-facade.ts#getCreateJestTestRunner` was incorrectly typed. _technically_ this was correct in that it returned `any`, which can be a function. however, we were not explicit/clear that this was a function being returned in the JSDoc. 2. `jest-runner.ts#createTestRunner` was incorrectly typed. Again, this was _technically_ correct in that it used `any`, but it was unclear that an anonymous class was returned by this function. 3. The anonymous class that is returned by `createTestRunner` for Jest 28/29 was incorrectly typed. the dynamic import of `jest-runner` from Jest was typed as `any`, which caused the overrides of `runTests` to be improperly typed. in fact, it revealed we were not passing arguments correctly to the parent class. by removing the dynamic import within the `jest-runner.ts` implementations for each respective version of jest, stencil's bundler (for the compiler itself) began to pull in additional files to the bundle that it wasn't able to process. Jest's `jest-runner` module was already being dynamically imported, and was deemed to externalize in stencil's testing bundle. STENCIL-960: Narrow Jest Runner Type
- Loading branch information
1 parent
f73aa14
commit 5c4ac32
Showing
6 changed files
with
41 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters