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

chore: migrated to vitest #2296

Merged
merged 13 commits into from Dec 11, 2023
Merged

Conversation

nickytonline
Copy link
Member

@nickytonline nickytonline commented Dec 8, 2023

Description

As discussed on Slack, we're moving to vitest.

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Close #2297

Mobile & Desktop Screenshots/Recordings

Steps to QA

The test should pass as we're just moving to another testing framework.

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Copy link

netlify bot commented Dec 8, 2023

βœ… Deploy Preview for oss-insights ready!

Name Link
πŸ”¨ Latest commit 715bb91
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/65779446d170ac0008103841
😎 Deploy Preview https://deploy-preview-2296--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 8, 2023

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit 715bb91
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/657794465d46c3000830415e
😎 Deploy Preview https://deploy-preview-2296--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nickytonline nickytonline marked this pull request as draft December 8, 2023 20:39
@nickytonline nickytonline force-pushed the nickytonline/add-vitest-for-testing branch from be26387 to bdb60e7 Compare December 8, 2023 20:45
vitest.config.ts Show resolved Hide resolved
vitest.config.ts Show resolved Hide resolved
@nickytonline nickytonline force-pushed the nickytonline/add-vitest-for-testing branch from bdb60e7 to ce59ff0 Compare December 8, 2023 20:49
@nickytonline nickytonline marked this pull request as ready for review December 8, 2023 20:50
@nickytonline
Copy link
Member Author

nickytonline commented Dec 8, 2023

Just sorting out one failing test. βœ…

package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
@nickytonline nickytonline force-pushed the nickytonline/add-vitest-for-testing branch from aa7c490 to f304a94 Compare December 9, 2023 22:49
@nickytonline nickytonline force-pushed the nickytonline/add-vitest-for-testing branch from e8662e3 to 1f5b82a Compare December 11, 2023 21:16
@nickytonline
Copy link
Member Author

nickytonline commented Dec 11, 2023

I'm getting this error which seems to be a pretty recent issue. (see vitest-dev/vitest#4726) Fixed by upgrading to 1.0.4

> @open-sauced/insights@1.79.2-beta.1 test
> vitest run

/home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js:87
		throw new Error(
		      ^

Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js:96:48)
    ... 3 lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:[10](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:11)13:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async main (file:///home/runner/work/app/app/node_modules/vitest/dist/cli-wrapper.js:45:5) {
  [cause]: Error: Cannot find module '@rollup/rollup-linux-x64-gnu'
  Require stack:
  - /home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:[11](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:12)34:15)
      at Module._load (node:internal/modules/cjs/loader:975:27)
      at Module.require (node:internal/modules/cjs/loader:[12](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:13)25:19)
      at require (node:internal/modules/helpers:177:18)
      at requireWithFriendlyError (/home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js:96:48)
      at Module._compile (node:internal/modules/cjs/loader:[13](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:14)56:[14](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:15))
      at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
      at Module.load (node:internal/modules/cjs/loader:1[19](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:20)7:[32](https://github.com/open-sauced/app/actions/runs/7173511276/job/19533013351?pr=2296#step:6:33))
      at Module._load (node:internal/modules/cjs/loader:1013:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/home/runner/work/app/app/node_modules/vite/node_modules/rollup/dist/native.js'
    ]
  }
}

Copy link
Contributor

@brandonroberts brandonroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’Ή

@nickytonline nickytonline merged commit 22cb998 into beta Dec 11, 2023
12 checks passed
@nickytonline nickytonline deleted the nickytonline/add-vitest-for-testing branch December 11, 2023 23:06
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.

chore: migrate to vitest
3 participants