As of 3 days ago karma-nightmare has stopped working in my unit tests when running yarn test on CircleCI. I’ve tried with/without sudo and I’m still having problems. I can run the tests locally and they behave just fine.
When run on the server I get an error saying that Karma cannot start:
$ ./node_modules/karma/bin/karma start config/test/karma.conf.js
clean-webpack-plugin: /home/circleci/project/resources/dist/ is outside of the project root. Skipping...
clean-webpack-plugin: /home/circleci/project/resources/dist/ is outside of the project root. Skipping...
11 05 2018 15:15:27.809:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
11 05 2018 15:15:27.811:INFO [launcher]: Launching browser Nightmare with unlimited concurrency
11 05 2018 15:15:27.837:INFO [launcher]: Starting browser Nightmare
11 05 2018 15:15:28.048:ERROR [launcher]: Cannot start Nightmare
11 05 2018 15:15:28.048:ERROR [launcher]: Nightmare stdout:
11 05 2018 15:15:28.048:ERROR [launcher]: Nightmare stderr:
11 05 2018 15:15:28.055:INFO [launcher]: Trying to start Nightmare again (1/2).
11 05 2018 15:15:28.208:ERROR [launcher]: Cannot start Nightmare
11 05 2018 15:15:28.208:ERROR [launcher]: Nightmare stdout:
11 05 2018 15:15:28.208:ERROR [launcher]: Nightmare stderr:
11 05 2018 15:15:28.209:INFO [launcher]: Trying to start Nightmare again (2/2).
11 05 2018 15:15:28.356:ERROR [launcher]: Cannot start Nightmare
11 05 2018 15:15:28.356:ERROR [launcher]: Nightmare stdout:
11 05 2018 15:15:28.356:ERROR [launcher]: Nightmare stderr:
11 05 2018 15:15:28.357:ERROR [launcher]: Nightmare failed 2 times (cannot start). Giving up.
–
version: 2
jobs:
# Builds the project and tests it
build-and-test:
docker:
- image: circleci/node:latest-browsers
steps:
- run:
name: "Checking Versions"
command: |
node --version
npm --version
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- run:
name: "Installing Yarn Packages"
command: |
yarn install
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package.json" }}
- run:
name: "Running Unit Tests"
command: |
yarn build
yarn test
Has anything changed lately that might prevent this? It went from one build working to the next breaking without any change.
See if there are some logs, or a verbose mode of operation.