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 #372

Merged
merged 6 commits into from
Sep 23, 2024
Merged

Replace Jest with Vitest #372

merged 6 commits into from
Sep 23, 2024

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Sep 23, 2024

ESLint 9 has first class support for ESM, and I'm planning to migrate to ESM in #370. Unfortunately Jest doesn't support ESM out of the box, and it's hard to configure properly to support it. Vitest supports ESM natively, without any configuration.

The test files are mostly the same, with the only differences being that they are now ESM, and describe, it, expect must be explicitly imported.

This is a prerequisite for #370.

@Mrtenz Mrtenz requested review from a team as code owners September 23, 2024 10:16
Copy link

socket-security bot commented Sep 23, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@esbuild/aix-ppc64@0.21.5 None 0 10.5 MB evanw
npm/@esbuild/android-arm@0.21.5 None 0 11.7 MB evanw
npm/@esbuild/android-arm64@0.21.5 None 0 9.96 MB evanw
npm/@esbuild/android-x64@0.21.5 None 0 11.7 MB evanw
npm/@esbuild/darwin-arm64@0.21.5 None 0 9.86 MB evanw
npm/@esbuild/darwin-x64@0.21.5 None 0 10.3 MB evanw
npm/@esbuild/freebsd-arm64@0.21.5 None 0 8.98 MB evanw
npm/@esbuild/freebsd-x64@0.21.5 None 0 9.71 MB evanw
npm/@esbuild/linux-arm@0.21.5 None 0 9.31 MB evanw
npm/@esbuild/linux-arm64@0.21.5 None 0 8.98 MB evanw
npm/@esbuild/linux-ia32@0.21.5 None 0 9.25 MB evanw
npm/@esbuild/linux-loong64@0.21.5 None 0 9.5 MB evanw
npm/@esbuild/linux-mips64el@0.21.5 None 0 10.6 MB evanw
npm/@esbuild/linux-ppc64@0.21.5 None 0 9.24 MB evanw
npm/@esbuild/linux-riscv64@0.21.5 None 0 9.24 MB evanw
npm/@esbuild/linux-s390x@0.21.5 None 0 10.2 MB evanw
npm/@esbuild/linux-x64@0.21.5 None 0 9.71 MB evanw
npm/@esbuild/netbsd-x64@0.21.5 None 0 9.69 MB evanw
npm/@esbuild/openbsd-x64@0.21.5 None 0 9.73 MB evanw
npm/@esbuild/sunos-x64@0.21.5 None 0 9.69 MB evanw
npm/@esbuild/win32-arm64@0.21.5 None 0 9.08 MB evanw
npm/@esbuild/win32-ia32@0.21.5 None 0 9.56 MB evanw
npm/@esbuild/win32-x64@0.21.5 None 0 9.91 MB evanw
npm/@jridgewell/sourcemap-codec@1.5.0 None 0 113 kB jridgewell
npm/@rollup/rollup-android-arm-eabi@4.22.4 None 0 1.47 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-android-arm64@4.22.4 None 0 2.05 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-darwin-arm64@4.22.4 None 0 2.18 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-darwin-x64@4.22.4 None 0 2.32 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-linux-arm-gnueabihf@4.22.4 None 0 2.22 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-linux-arm-musleabihf@4.22.4 None 0 2.21 MB lukastaegert
npm/@rollup/rollup-linux-arm64-gnu@4.22.4 None 0 2.23 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-linux-arm64-musl@4.22.4 None 0 2.12 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-linux-powerpc64le-gnu@4.22.4 None 0 2.76 MB lukastaegert
npm/@rollup/rollup-linux-riscv64-gnu@4.22.4 None 0 2.25 MB lukastaegert
npm/@rollup/rollup-linux-s390x-gnu@4.22.4 None 0 3.8 MB lukastaegert
npm/@rollup/rollup-linux-x64-gnu@4.22.4 None 0 2.49 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-linux-x64-musl@4.22.4 None 0 2.48 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-win32-arm64-msvc@4.22.4 None 0 2.74 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-win32-ia32-msvc@4.22.4 None 0 2.53 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@rollup/rollup-win32-x64-msvc@4.22.4 None 0 3.28 MB guybedford, lukastaegert, rich_harris, ...1 more
npm/@types/estree@1.0.5 None 0 25.7 kB types
npm/@vitest/expect@2.1.1 None 0 149 kB vitestbot
npm/@vitest/mocker@2.1.1 None 0 121 kB vitestbot
npm/@vitest/pretty-format@2.1.1 environment 0 45.3 kB vitestbot
npm/@vitest/runner@2.1.1 None 0 87.9 kB vitestbot
npm/@vitest/snapshot@2.1.1 None 0 0 B
npm/@vitest/spy@2.1.1 None 0 19.1 kB vitestbot
npm/@vitest/utils@2.1.1 None 0 153 kB antfu, oreanno, patak, ...1 more
npm/assertion-error@2.0.1 None 0 5.83 kB chaijs
npm/cac@6.7.14 None 0 81.8 kB egoist
npm/chai@5.1.1 None 0 506 kB chaijs
npm/check-error@2.1.1 None 0 11.4 kB chaijs
npm/deep-eql@5.0.2 None 0 23.9 kB chaijs
npm/detect-newline@4.0.1 None 0 3.96 kB sindresorhus
npm/esbuild@0.21.5 environment, filesystem, network, shell 0 133 kB evanw
npm/estree-walker@3.0.3 None 0 17.6 kB rich_harris
npm/fsevents@2.3.3 None 0 173 kB pipobscure
npm/get-func-name@2.0.2 None 0 8.68 kB keithamus
npm/loupe@3.1.1 None 0 60.5 kB chaijs
npm/magic-string@0.30.11 None 0 464 kB antfu
npm/nanoid@3.3.7 None 0 24.4 kB ai
npm/pathe@1.1.2 None 0 30.8 kB pi0
npm/pathval@2.0.0 None 0 15 kB chaijs
npm/picocolors@1.1.0 environment 0 11.4 kB alexeyraspopov
npm/postcss@8.4.47 environment, filesystem 0 200 kB ai
npm/rollup@4.22.4 None 0 2.27 MB eventualbuddha, lukastaegert, rich_harris, ...2 more
npm/siginfo@2.0.0 None 0 4.79 kB emilbayes
npm/source-map-js@1.2.1 None 0 140 kB 7rulnik
npm/stackback@0.0.2 None 0 6.88 kB shtylman
npm/std-env@3.7.0 None 0 26.2 kB pi0
npm/tinybench@2.9.0 None 0 62.9 kB aslemammad
npm/tinyexec@0.3.0 environment, shell 0 45.4 kB 43081j
npm/tinypool@1.0.1 filesystem, shell, unsafe 0 49.9 kB ariperkkio
npm/tinyrainbow@1.2.0 None 0 7.91 kB oreanno
npm/tinyspy@3.0.2 None 0 17.6 kB antfu, aslemammad, oreanno
npm/vite-node@2.1.1 None 0 202 kB antfu, oreanno, patak, ...1 more
npm/vite@5.4.7 None 0 3.26 MB antfu, patak, soda, ...2 more
npm/vitest@2.1.1 None 0 1.62 MB antfu, oreanno, patak, ...1 more
npm/why-is-node-running@2.3.0 filesystem, unsafe 0 7.3 kB mafintosh

🚮 Removed packages: npm/@ampproject/remapping@2.2.1, npm/@babel/code-frame@7.24.2, npm/@babel/compat-data@7.24.1, npm/@babel/core@7.24.3, npm/@babel/generator@7.24.1, npm/@babel/helper-compilation-targets@7.23.6, npm/@babel/helper-environment-visitor@7.22.20, npm/@babel/helper-function-name@7.23.0, npm/@babel/helper-hoist-variables@7.22.5, npm/@babel/helper-module-imports@7.24.3, npm/@babel/helper-module-transforms@7.23.3, npm/@babel/helper-plugin-utils@7.22.5, npm/@babel/helper-simple-access@7.22.5, npm/@babel/helper-split-export-declaration@7.22.6, npm/@babel/helper-string-parser@7.24.1, npm/@babel/helper-validator-identifier@7.22.20, npm/@babel/helper-validator-option@7.23.5, npm/@babel/helpers@7.24.1, npm/@babel/highlight@7.24.2, npm/@babel/parser@7.24.1, npm/@babel/plugin-syntax-jsx@7.22.5, npm/@babel/plugin-syntax-typescript@7.22.5, npm/@babel/template@7.24.0, npm/@babel/traverse@7.24.1, npm/@babel/types@7.24.0, npm/@jridgewell/sourcemap-codec@1.4.15, npm/@sinonjs/commons@3.0.0, npm/@types/babel__core@7.20.1, npm/@types/babel__generator@7.6.4, npm/@types/babel__template@7.4.1, npm/@types/babel__traverse@7.20.1, npm/@types/graceful-fs@4.1.5, npm/@types/istanbul-lib-coverage@2.0.4, npm/@types/istanbul-lib-report@3.0.0, npm/@types/istanbul-reports@3.0.1, npm/@types/jest@29.5.12, npm/@types/node@18.11.9, npm/@types/stack-utils@2.0.1, npm/@types/yargs-parser@21.0.0, npm/@types/yargs@17.0.13, npm/anymatch@3.1.2, npm/babel-preset-current-node-syntax@1.0.1, npm/browserslist@4.23.0, npm/caniuse-lite@1.0.30001600, npm/ci-info@3.5.0, npm/cjs-module-lexer@1.2.2, npm/collect-v8-coverage@1.0.1, npm/dedent@1.5.1, npm/deepmerge@4.2.2, npm/electron-to-chromium@1.4.717, npm/fsevents@2.3.2, npm/import-local@3.1.0, npm/istanbul-lib-coverage@3.2.0, npm/istanbul-lib-instrument@6.0.2, npm/istanbul-lib-report@3.0.0, npm/istanbul-reports@3.1.5, npm/make-dir@3.1.0, npm/node-releases@2.0.14, npm/picocolors@1.0.0, npm/pirates@4.0.5, npm/pure-rand@6.0.2, npm/react-is@18.2.0, npm/update-browserslist-db@1.0.13, npm/v8-to-istanbul@9.0.1

View full report↗︎

Copy link

socket-security bot commented Sep 23, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/anymatch@3.1.3, npm/esbuild@0.21.5, npm/glob@7.2.3, npm/inflight@1.0.6, npm/istanbul-lib-report@3.0.1, npm/tinyexec@0.3.0, npm/tinypool@1.0.1, npm/wrappy@1.0.2

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@Mrtenz
Copy link
Member Author

Mrtenz commented Sep 23, 2024

@SocketSecurity ignore npm/glob@7.2.3
@SocketSecurity ignore npm/inflight@1.0.6

Not used in production, though we should look into this.

@SocketSecurity ignore npm/wrappy@1.0.2
@SocketSecurity ignore npm/istanbul-lib-report@3.0.1
@SocketSecurity ignore npm/anymatch@3.1.3

New author is ok.

@SocketSecurity ignore npm/esbuild@0.21.5
@SocketSecurity ignore npm/tinypool@1.0.1
@SocketSecurity ignore npm/tinyexec@0.3.0

Network and shell access is expected.

Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

LGTM!

@Mrtenz Mrtenz merged commit cce1f4b into main Sep 23, 2024
13 checks passed
@Mrtenz Mrtenz deleted the mrtenz/vitest branch September 23, 2024 11:00
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