Hier ist mein Fehlercodes:Fehler werden ausgelöst, aber Jest des `toThrow()` nicht erfasst den Fehler
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>
Wie Sie der Fehler tatsächlich aufgetreten ist sehen: Function FunctionThatDoesNotExistsInString does not exists in string.
. Es wird jedoch nicht als ein Pass in Jest erfasst.
Hier ist mein Codes:
test(`
expect(CheckFunctionExistenceByStr(
'any string', 'FunctionThatDoesNotExistsInString'
)).toThrow();
`,() => {
expect(CheckFunctionExistenceByStr(
'any string', 'FunctionThatDoesNotExistsInString'
)).toThrow();
}
);