Throws an error if no error is thrown and vice versa.
npm install expect-errorThrows an error if no error was thrown and vice versa.
1. npm install expect-error
2.
``
const expectError = require('expect-error');
expectError(() => {
return 'foo';
}); // This will throw an error.
expectError(() => {
throw new Error('foo');
}); // This will not throw an error.
`
npm test
``