Skip to content

Commit 3ac8b5a

Browse files
committed
test: yield to warnings printer
1 parent 9a9f8a9 commit 3ac8b5a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test/fixtures/stacktrace.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
enum Foo {
22
A = "Hello, TypeScript!",
33
}
4-
throw new Error(Foo.A);
4+
5+
// Allow warnings about source maps to be shown for testing purposes.
6+
setImmediate(() => {
7+
throw new Error(Foo.A);
8+
});

test/loader.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test("should warn and inaccurate stracktrace", async () => {
4747

4848
strictEqual(result.stdout, "");
4949
match(result.stderr, /Source maps are disabled/);
50-
match(result.stderr, /stacktrace.ts:5:7/); // inaccurate
50+
match(result.stderr, /stacktrace.ts:7:11/); // inaccurate
5151
strictEqual(result.code, 1);
5252
});
5353

@@ -60,7 +60,7 @@ test("should not warn and accurate stracktrace", async () => {
6060

6161
doesNotMatch(result.stderr, /Source maps are disabled/);
6262
strictEqual(result.stdout, "");
63-
match(result.stderr, /stacktrace.ts:4:7/); // accurate
63+
match(result.stderr, /stacktrace.ts:7:9/); // accurate
6464
strictEqual(result.code, 1);
6565
});
6666

0 commit comments

Comments
 (0)