I'm having a very strange issue:
Working on a project, which is a monorepo managed with lerna
, I am unable to run tests for some reason unless I use sudo. I know it is not a project configuration issue, because no one else on my team is experiencing this problem.
The error, which is thrown immediately, ends up being:
Jest encountered an unexpected token
...
/Users/jasmar/dev/project/src/__setup__/setupTest.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { configure } from 'enzyme';
My environment is:
- Mac OS X High Sierra
- yarn (installed via brew)
- Node 8.10.0 (via nvm; installed via curl)
I am an admin on the machine and have run sudo chmod -R ug+w .
against the project directory to no avail.
I've also tried npm run test
to no avail.
The test script that yarn runs is FORCE_COLOR=1 lerna --concurrency=4 run test
and I have tried dropping concurrency to 1.
While running sudo yarn test
does work, it is problematic as it generates new snapshots with incorrect permissions and makes managing version control extremely difficult.
Any ideas would be hugely appreciated.
Thanks!