Parallelism using npm test

nodejs
paralellism
circle.yml

#1

Has anyone successfully achieved parallel testing for Nodejs?
I have the following setup but it’s not appending the files in the glob to my npm test command.

override:
    - npm test -- --reporter mocha-junit-reporter:
      environment:
        MOCHA_FILE: $CIRCLE_TEST_REPORTS/junit/test-results.xml
      parallel: true
      files:
        - test/**/*.js

I also tried manually splitting the tests up using CIRCLE_NODE_INDEX but it’s coming up as index 0 for both my parallel containers. It shows 0 and 1 in the Start Container phase but in my Test phase they both show 0.


#2

I had a similar issue turns out parallel: true should be double-indented in order for the Test commands to run on different nodes.


#3