diff --git a/test/fixtures/stacktrace.ts b/test/fixtures/stacktrace.ts index 7314a6568..9a155e864 100644 --- a/test/fixtures/stacktrace.ts +++ b/test/fixtures/stacktrace.ts @@ -1,4 +1,8 @@ enum Foo { A = "Hello, TypeScript!", } -throw new Error(Foo.A); + +// Allow warnings about source maps to be shown for testing purposes. +setImmediate(() => { + throw new Error(Foo.A); +}); diff --git a/test/loader.test.js b/test/loader.test.js index d3ed4a3c4..3d00a86db 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -47,7 +47,7 @@ test("should warn and inaccurate stracktrace", async () => { strictEqual(result.stdout, ""); match(result.stderr, /Source maps are disabled/); - match(result.stderr, /stacktrace.ts:5:7/); // inaccurate + match(result.stderr, /stacktrace.ts:7:11/); // inaccurate strictEqual(result.code, 1); }); @@ -60,7 +60,7 @@ test("should not warn and accurate stracktrace", async () => { doesNotMatch(result.stderr, /Source maps are disabled/); strictEqual(result.stdout, ""); - match(result.stderr, /stacktrace.ts:4:7/); // accurate + match(result.stderr, /stacktrace.ts:7:9/); // accurate strictEqual(result.code, 1); });