Comments (3)
I wonder if we should just ditch shelling out to find
always. Crawling in JS is way faster (as long as ignores are sane, which they usually are).
I don't have a windows system to debug with, unfortunately đ But changing the code to handle newline and optional carriage return might make sense? Would that help? If so, wanna send a PR for it?
from jest.
Sadly, just trimming the carriage returns doesn't work, it causes some issue down the line, something with path handling from the output. If I just changed the find
output handling to something that can optionally handle carriage returns, like this:
const lines = stdout
.trim()
.split('\n')
.map(line => line.replace(/\r$/g, ''))
.filter(x => !ignore(x));
It'll trigger haste module naming collisions:
jest-haste-map: Haste module naming collision: @bcoe/v8-coverage
The following files share their name; please adjust your hasteImpl:
* <rootDir>\node_modules\@bcoe\v8-coverage\dist\lib\package.json
* <rootDir>\node_modules\@bcoe\v8-coverage\package.json
jest-haste-map: Haste module naming collision: ansi-styles
The following files share their name; please adjust your hasteImpl:
* <rootDir>\node_modules\@babel\highlight\node_modules\ansi-styles\package.json
* <rootDir>\node_modules\ansi-styles\package.json
jest-haste-map: Haste module naming collision: chalk
The following files share their name; please adjust your hasteImpl:
* <rootDir>\node_modules\@babel\highlight\node_modules\chalk\package.json
* <rootDir>\node_modules\chalk\package.json
jest-haste-map: Haste module naming collision: color-convert
The following files share their name; please adjust your hasteImpl:
* <rootDir>\node_modules\@babel\highlight\node_modules\color-convert\package.json
* <rootDir>\node_modules\color-convert\package.json
This is most likely caused by the mixed slashes in the the paths (as the find
puts out forwards slashes, but they are joined with <rootDir>
which has backwards slashes). Paths like this are in fact valid Windows paths, so it likely has to happen while analysing them in js somewhere. If I also change all the slashes to backwards slashes (via .map(line => line.replace(/\//g, '\\'))
), the test will run fine, but that would ofc have to be conditioned on the os, (and I think it's not safe to do it dumbly like this anyway)
I haven't investigated further than that though, so unsure if that is all that's needed...
from jest.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
from jest.
Related Issues (20)
- [Bug]: Path in bin/jest.js file crash when there's a single "Single quote" in the path HOT 2
- [Feature]: Add config option "worker(Max)Retries" instead of hardcoded maxRetries: 3 in jest-runner đ
- can someone help me with Cannot use import statement outside a module please (âŦâŦīšâŦâŦ) HOT 2
- [Bug]: transform esm module in jest-runtime
- No tests found on Windows if any folder in path starts with special character HOT 3
- [Bug]: Unable to run multiple tests through -t argument HOT 4
- [Bug]: `constructorA.mock.instances` not correct when using `jest.fn().mockImplementation(() => ({ ... }))`
- Jest needs disclaimers.
- Document release process
- [Bug]: Jest fails to serialize custom elements with anonymous constructors
- [Bug]: Critical security finding in jest-reporters
- [Bug]: Incorrect Error Stacktrace when using Object.freeze(Object.prototype)
- [Bug]: when adding "disctributed" to a testfile name it no longer runs
- [Bug]: global object is not usable in globalTearDown file
- Top-level 'await' expressions not working even if tried a lot of solutions found in StackOverflow HOT 1
- [Feature]: Upgrade jest-environment-jsdom from v22 to v24 to avoid deprecated punycode warning HOT 1
- [Docs]: `react-test-renderer` deprecated HOT 2
- [Feature]: Support Babel v8 HOT 1
- [Bug]: `transform` does not accept `file:` urls
- [Feature]: babel-jest: opting out babel-preset-jest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest.