0

I am trying to use mocha for the first time. My dependency

"devDependencies": {
    "mocha": "^4.0.1"
  }

The test is trivial

describe("test 2", function () {
    it("test promise that failes", function () {
        return Promise.reject("I failed")
    })
})

When I

npm test

The test fails as expected but I need to ctnl c to get the prompt

Terminate batch job (Y/N)?

Typing Y give me back the command prompt.

I thought mocha handled rejected promises. What am I missing?

grabbag
  • 980
  • 1
  • 15
  • 33

1 Answers1

0

The problem was the test script portion of the package.json

it contained

  "scripts": {
    "test": "mocha --recursive --watch"
  },

removing the --recursive --watch solved the problem.

grabbag
  • 980
  • 1
  • 15
  • 33