prettier
23b4822e - Disable Jest's default transformer (Babel) (#10454)

Commit
4 years ago
Disable Jest's default transformer (Babel) (#10454) * Disable Jest's default transform (Babel) https://jestjs.io/docs/en/next/code-transformation#defaults Otherwise, I sometimes get this error because Babel tries to resolve Browserslist: ---- ● plugin search should not crash when prettier isn't inside a directory › encountered a declaration exception ENOENT: no such file or directory, stat '/mnt/d/dev/prettier/tests_integration/mnt/d/dev/prettier/tests_integration/runPrettier.js' 52 | jest.spyOn(fs, "statSync").mockImplementation((filename) => { 53 | if (path.basename(filename) === "virtualDirectory") { > 54 | return origStatSync(path.join(__dirname, __filename)); | ^ 55 | } 56 | return origStatSync(filename); 57 | }); at Object.<anonymous> (tests_integration/runPrettier.js:54:14) at isFile (node_modules/browserslist/node.js:38:42) at eachParent (node_modules/browserslist/node.js:46:13) at Object.getStat (node_modules/browserslist/node.js:197:15) at browserslist (node_modules/browserslist/index.js:433:19) at resolveTargets (node_modules/@babel/helper-compilation-targets/lib/index.js:174:46) ----
Author
Parents
Loading