-
Notifications
You must be signed in to change notification settings - Fork 525
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
Refactor jest configuration #2796
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I've pulled the branch and I'm running locally. |
0cb9878
to
b5f8e60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to pull down the branch on my M1 Mac, run the commands listed in the description, and receive successes on all of them. All the jest tests passed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting the following error and test failures for the victory-selection-container
and victory-errorbar
packages:
src/selection-helpers.test.tsx:7:28 - error TS2339: Property 'scaleLinear' does not exist on type 'typeof import(".../victory/packages/victory-selection-container/node_modules/victory-vendor/d3-scale")'.
7 const scale = { x: d3Scale.scaleLinear(), y: d3Scale.scaleLinear() };
When I add victory-vendor
as a dependency for both of those packages, it fixes the error and test failures.
Refactor the jest configuration to avoid cyclic dependencies in packages and support Windows platforms for running jest.
Changes
There are a couple major changes here that cause a lot of files to be changed.
Upgrades jest to the latest version and uses the built in TS runner for jest testing. This gives better support for IDE tooling that runs jest tests in real time as you code and the jest --watch function.
Adds jest config shells to every package. This avoids problems with paths so all configs are now relative to the package itself. This also fixes jest so that it now runs in all operation systems. 🪟
The sync-pkgs-wireit-helpers.js was updated to run the
jest
command directly without invokingnps
scripts. There is also a fix that ensures all deps are included in the wireit dependency array and removes the self-referencing dependency.Running
pnpm sync
then updates all package.json files with the new changes../chart.ts
) instead of virtual (victory-charts
) and removes all circular devDependencies from all packagespackage.json
filesMisc Changes
test/node/victory.test.js
as that functionality is tested inpackages/victory
as a snapshot.victory-native
from the tsconfig sync script, it has a custom config nowTesting Steps