davidmarkclements / 0x

πŸ”₯ single-command flamegraph profiling πŸ”₯

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run jest with 0x?

cmdcolin opened this issue Β· comments

Hi there,

I tried using just 0x node_modules/.bin/jest but it gives

% 0x node_modules/.bin/jest
πŸ”₯  ProfilingError: write EPIPE
    at ChildProcess.target._send (internal/child_process.js:806:20)
    at ChildProcess.target.send (internal/child_process.js:676:19)
    at ChildProcessWorker.send (/home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/workers/ChildProcessWorker.js:286:17)
    at WorkerPool.send (/home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/WorkerPool.js:32:34)
    at Farm._process (/home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/Farm.js:129:10)
    at Farm._enqueue (/home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/Farm.js:152:10)
    at Farm._push (/home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/Farm.js:159:12)
    at /home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/Farm.js:90:14
    at new Promise (<anonymous>)
    at Farm.doWork (/home/cdiesh/src/jbrowse-components/node_modules/jest-worker/build/Farm.js:56:12)
Target subprocess error, code: 1
πŸ”₯  Flamegraph generated in
file:///home/cdiesh/src/jbrowse-components/23267.0x/flamegraph.html

I've had luck with using 0x node_modules/.bin/jest specific_file.test.js instead of without any params

yeah this looks like a Jest specific thing, closing as you've found a work around

When I use 0x to profile jest tests it seems like I only get the graph for the jest execution itself, not for the tests running in it. I am using --runInBand, a testEnvironment: "node" and a single test file that is executed, so theoretically 0x should be able to pick up the executed test case.