X Tutup
Skip to content

Commit b9fdd40

Browse files
committed
add more test cases
1 parent 371c841 commit b9fdd40

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

test/unit/error.spec.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,27 @@ test.each([
339339
`.expectToMatchJsResult();
340340
});
341341

342-
test.each(["Error", "RangeError", "CustomError"])("get stack from %s", errorType => {
342+
test.each([
343+
"Error",
344+
"RangeError",
345+
"ReferenceError",
346+
"SyntaxError",
347+
"TypeError",
348+
"URIError",
349+
"new Error",
350+
"new RangeError",
351+
"new ReferenceError",
352+
"new SyntaxError",
353+
"new TypeError",
354+
"new URIError",
355+
"new CustomError",
356+
])("get stack from %s", errorType => {
343357
const stack = util.testFunction`
344358
class CustomError extends Error {
345-
public name = "MyError";
359+
public name = "CustomError";
346360
}
347-
function innerFunctionThatThrows() { throw new ${errorType}(); }
361+
362+
function innerFunctionThatThrows() { throw ${errorType}(); }
348363
function outerFunctionThatThrows() { innerFunctionThatThrows(); }
349364
350365
try {

0 commit comments

Comments
 (0)
X Tutup