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

Replace Jest with Vitest #457

Merged
merged 6 commits into from
Aug 15, 2024
Merged

Replace Jest with Vitest #457

merged 6 commits into from
Aug 15, 2024

Conversation

jbouder
Copy link
Collaborator

@jbouder jbouder commented Aug 12, 2024

This update is intended to provide the following:

  • Replaces 8 Jest specific packages with 2 vitest related packages
  • Same base unit test functionality
  • Faster unit testing speeds
  • Inline with existing Vite ecosystem

Reference Issues or PRs

N/A

What does this implement/fix?

Put a x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a feature)
  • Breaking change (fix or feature that would cause existing features not to work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Other (please describe):

Testing

  • Did you test the pull request locally?
  • Did you add new tests?

Any other comments?

  • Replaced Jest packages and configs with Vitest
  • Updated all tests as needed

Copy link

vercel bot commented Aug 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jhub-apps ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 3:04pm
jhub-apps-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 3:04pm

@jbouder
Copy link
Collaborator Author

jbouder commented Aug 12, 2024

@aktech , can you check the vercel failure above? I thought I had access to Vercel, but can't seem to get to it.

@aktech
Copy link
Member

aktech commented Aug 15, 2024

I thought I had access to Vercel, but can't seem to get to it.

I think that's probably not possible in the free version IIRC.

Here are the logs:

Logs (click to expand)
[14:36:10.761] Running build in Washington, D.C., USA (East) – iad1
[14:36:10.996] Cloning github.com/nebari-dev/jhub-apps (Branch: vitest, Commit: 75d79a5)
[14:36:13.596] Cloning completed: 2.599s
[14:36:18.446] Restored build cache
[14:36:18.642] Running "vercel build"
[14:36:19.648] Vercel CLI 35.2.3
[14:36:22.154] Installing dependencies...
[14:36:26.023] 
[14:36:26.024] > nebari-hub@1.0.0 prepare
[14:36:26.025] > cd .. && husky
[14:36:26.025] 
[14:36:26.095] 
[14:36:26.095] added 13 packages, removed 12 packages, and changed 11 packages in 4s
[14:36:26.096] 
[14:36:26.096] 167 packages are looking for funding
[14:36:26.096]   run `npm fund` for details
[14:36:26.554] 
[14:36:26.554] > nebari-hub@1.0.0 build:dev
[14:36:26.554] > tsc && NODE_ENV=development vite build --mode development
[14:36:26.555] 
[14:36:39.322] �[31mfailed to load config from /vercel/path0/ui/vite.config.ts�[39m
[14:36:39.330] �[31merror during build:
[14:36:39.331] Error: The package "@esbuild/linux-x64" could not be found, and is needed by esbuild.
[14:36:39.331] 
[14:36:39.331] If you are installing esbuild with npm, make sure that you don't specify the
[14:36:39.331] "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
[14:36:39.332] of "package.json" is used by esbuild to install the correct binary executable
[14:36:39.332] for your current platform.
[14:36:39.332]     at generateBinPath (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1747:15)
[14:36:39.332]     at esbuildCommandAndArgs (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1817:33)
[14:36:39.332]     at ensureServiceIsRunning (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1974:25)
[14:36:39.332]     at build (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1873:26)
[14:36:39.332]     at bundleConfigFile (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:66435:24)
[14:36:39.337]     at loadConfigFromFile (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:66405:27)
[14:36:39.337]     at resolveConfig (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:66014:30)
[14:36:39.337]     at build (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:65111:24)
[14:36:39.337]     at CAC.<anonymous> (file:///vercel/path0/ui/node_modules/vite/dist/node/cli.js:828:11)�[39m
[14:36:39.354] Error: Command "npm run build:dev" exited with 1
[14:36:39.999] 

@jbouder
Copy link
Collaborator Author

jbouder commented Aug 15, 2024

I thought I had access to Vercel, but can't seem to get to it.

I think that's probably not possible in the free version IIRC.

Here are the logs:

Logs (click to expand)

[14:36:10.761] Running build in Washington, D.C., USA (East) – iad1
[14:36:10.996] Cloning github.com/nebari-dev/jhub-apps (Branch: vitest, Commit: 75d79a5)
[14:36:13.596] Cloning completed: 2.599s
[14:36:18.446] Restored build cache
[14:36:18.642] Running "vercel build"
[14:36:19.648] Vercel CLI 35.2.3
[14:36:22.154] Installing dependencies...
[14:36:26.023] 
[14:36:26.024] > nebari-hub@1.0.0 prepare
[14:36:26.025] > cd .. && husky
[14:36:26.025] 
[14:36:26.095] 
[14:36:26.095] added 13 packages, removed 12 packages, and changed 11 packages in 4s
[14:36:26.096] 
[14:36:26.096] 167 packages are looking for funding
[14:36:26.096]   run `npm fund` for details
[14:36:26.554] 
[14:36:26.554] > nebari-hub@1.0.0 build:dev
[14:36:26.554] > tsc && NODE_ENV=development vite build --mode development
[14:36:26.555] 
[14:36:39.322] �[31mfailed to load config from /vercel/path0/ui/vite.config.ts�[39m
[14:36:39.330] �[31merror during build:
[14:36:39.331] Error: The package "@esbuild/linux-x64" could not be found, and is needed by esbuild.
[14:36:39.331] 
[14:36:39.331] If you are installing esbuild with npm, make sure that you don't specify the
[14:36:39.331] "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
[14:36:39.332] of "package.json" is used by esbuild to install the correct binary executable
[14:36:39.332] for your current platform.
[14:36:39.332]     at generateBinPath (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1747:15)
[14:36:39.332]     at esbuildCommandAndArgs (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1817:33)
[14:36:39.332]     at ensureServiceIsRunning (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1974:25)
[14:36:39.332]     at build (/vercel/path0/ui/node_modules/esbuild/lib/main.js:1873:26)
[14:36:39.332]     at bundleConfigFile (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:66435:24)
[14:36:39.337]     at loadConfigFromFile (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:66405:27)
[14:36:39.337]     at resolveConfig (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:66014:30)
[14:36:39.337]     at build (file:///vercel/path0/ui/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:65111:24)
[14:36:39.337]     at CAC.<anonymous> (file:///vercel/path0/ui/node_modules/vite/dist/node/cli.js:828:11)�[39m
[14:36:39.354] Error: Command "npm run build:dev" exited with 1
[14:36:39.999] 

Added an optional dependency. Looks good now.

@aktech aktech merged commit 8c258b7 into main Aug 15, 2024
25 checks passed
@aktech aktech deleted the vitest branch August 15, 2024 15:21
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.

2 participants