“UnhandledPromiseRejectionWarning” error even when catch is present
问题 So I have this code, createExampleDir is not yet implemented, so the test fails: let chai = require('chai'); let expect = chai.expect; let homeDir = require('home-dir'); let lib = require('../lib.js'); chai.use(require('chai-fs')); let dir = homeDir('/example-dir'); describe('lib', () => describe('createExampleDir', () => it('should find ~/example-dir', () => lib.createExampleDir() .then(() => expect(dir).to.be.a.directory()) .catch(() => {throw Error('Who cares!');}) ) ) ); The problem is