1
내 오류 코드 캡처하지 않습니다 Function FunctionThatDoesNotExistsInString does not exists in string.
를 : 오류가 실제로 발생 않았다 볼 수 있듯이오류가 발생하지만, 농담의`toThrow는()`오류 여기
FAIL build/__test__/FuncOps.CheckFunctionExistenceByString.test.js
●
expect(CheckFunctionExistenceByStr(
'any string', 'FunctionThatDoesNotExistsInString'
)).toThrow();
Function FunctionThatDoesNotExistsInString does not exists in string.
at CheckFunctionExistenceByStr (build/FuncOps.js:35:15)
at Object.<anonymous> (build/__test__/FuncOps.CheckFunctionExistenceByString.test.js:12:51)
at new Promise (<anonymous>)
at <anonymous>
합니다. 그러나 그것은 Jest에서 패스로 캡처되지 않습니다.
test(`
expect(CheckFunctionExistenceByStr(
'any string', 'FunctionThatDoesNotExistsInString'
)).toThrow();
`,() => {
expect(CheckFunctionExistenceByStr(
'any string', 'FunctionThatDoesNotExistsInString'
)).toThrow();
}
);