chore(jest-util): replace slash with inline implementation#15971
Open
roli-lpci wants to merge 5 commits intojestjs:mainfrom
Open
chore(jest-util): replace slash with inline implementation#15971roli-lpci wants to merge 5 commits intojestjs:mainfrom
slash with inline implementation#15971roli-lpci wants to merge 5 commits intojestjs:mainfrom
Conversation
Replace the `slash` package with a 3-line inline implementation in `jest-util`. The `slash` package simply replaces backslashes with forward slashes — a one-liner that doesn't need an external dependency. - New `slash` function exported from `jest-util` - Updated imports across all 20 consumer files - Removed `slash` from all 14 package.json dependencies - Added `jest-util` dependency to babel-jest, jest-message-util, and jest-test-sequencer (which didn't previously depend on it) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Add missing tsconfig.json project references for packages that gained jest-util as a new dependency (babel-jest, jest-message-util, jest-test-sequencer). The buildTs.mjs validation script asserts that tsconfig references match workspace dependencies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
babel-jest
babel-plugin-jest-hoist
babel-preset-jest
create-jest
@jest/diff-sequences
expect
@jest/expect-utils
jest
jest-changed-files
jest-circus
jest-cli
jest-config
@jest/console
@jest/core
@jest/create-cache-key-function
jest-diff
jest-docblock
jest-each
@jest/environment
jest-environment-jsdom
@jest/environment-jsdom-abstract
jest-environment-node
@jest/expect
@jest/fake-timers
@jest/get-type
@jest/globals
jest-haste-map
jest-jasmine2
jest-leak-detector
jest-matcher-utils
jest-message-util
jest-mock
@jest/pattern
jest-phabricator
jest-regex-util
@jest/reporters
jest-resolve
jest-resolve-dependencies
jest-runner
jest-runtime
@jest/schemas
jest-snapshot
@jest/snapshot-utils
@jest/source-map
@jest/test-result
@jest/test-sequencer
@jest/transform
@jest/types
jest-util
jest-validate
jest-watcher
jest-worker
pretty-format
commit: |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removing the slash import from jest-resolve changed line numbers in the built output, causing snapshot mismatches in moduleNameMapper, requireMissingExt, and resolveNoFileExtensions tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the
slashpackage with an inline implementation injest-util. The entireslashpackage ispath.replace(/\\/g, '/')— a one-liner that doesn't need an external dependency.slashfunction exported fromjest-util(3 lines, usesString.prototype.replaceAll).tssource files, 3.jstest files, 2 e2e test fixtures)slashfrom all 14package.jsondependency entries (13 packages + root)jest-utildependency tobabel-jest,jest-message-util, and@jest/test-sequencer(which didn't previously depend on it)Note: this does not touch
replacePathSepForGlob, which is a different function that only replacespath.sep(preserving glob escape chars).Test plan
yarn constraintspassesyarn dedupe --checkpassesfrom 'slash'orrequire('slash')imports outsidenode_modules