0

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!

tk421
  • 5,775
  • 6
  • 23
  • 34
Jonny Asmar
  • 1,900
  • 14
  • 16

1 Answers1

-1

remove the underscores for SetUp

  • 1
    Any explanation as to why this would help? I seem to remember something about symbols in path names, but I can't recall exactly what it is. – l3l_aze Dec 22 '18 at 22:12
  • Very interesting suggestion? I would definitely like to know why you think that might help? Also, what could cause it to be problematic on my machine, but not the rest of my teams? – Jonny Asmar Dec 23 '18 at 04:32