Mocha v4 stops working (updated title)

nodejs

#1

After noticing recent tests fail with messages like:

 5 passing (2s)
 Too long with no output (exceeded 10m0s)

Using a very basic (and unchanged script)

for MODULE in "${MODULES_TO_TEST[@]}"
do
	echo "Testing ${MODULE}"
	if [ -d "node_modules/${MODULE}/test" ]; then
		cd node_modules/${MODULE}
		# Inverse grep, ie, run all tests except tests that we should skip due to networking restrictions in CircleCI
		mocha -i -g 'network|skip'
		cd $ORIGINAL_DIR
	fi
done

I’ve attempted to repeat a previous successful build and it’s failed. Ie, literally click a green build, repeat it, and the same thing happens - execution simply stops, with no failures, then a time out fails the build.

Any one know what’s happening or how to make Circle 2.0 work again?


#2

Issue was installing latest mocha: mocha 4 was released, and will no longer exit unless ‘–exit’ is supplied. See https://github.com/mochajs/mocha/issues/2879

I was using mocha v3 on my machine, mocha v4 on circleci.

I’ve updated the title to reference mocha explicitly.


#3