From 4e057603c597c0c2ca000542f9924b69f926b015 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 22 Dec 2020 17:16:50 +1100 Subject: [PATCH] really fix tests on windows --- cli/tests/compiler_api_test.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts index 79e18aa6c9fa8f..6f58356df502d8 100644 --- a/cli/tests/compiler_api_test.ts +++ b/cli/tests/compiler_api_test.ts @@ -141,11 +141,10 @@ Deno.test({ assertEquals(diagnostics.length, 0); assert(!ignoredOptions); assertEquals(stats.length, 3); - assertEquals( - Object.keys(files).sort(), - ["file:///foo.ts.js", "file:///foo.ts.js.map"], - ); - assert(files["file:///foo.ts.js"].startsWith("export var Foo;")); + const keys = Object.keys(files).sort(); + assert(keys[0].endsWith("/foo.ts.js")); + assert(keys[1].endsWith("/foo.ts.js.map")); + assert(files[keys[0]].startsWith("export var Foo;")); }, }); @@ -166,11 +165,10 @@ Deno.test({ assertEquals(diagnostics.length, 0); assert(!ignoredOptions); assertEquals(stats.length, 3); - assertEquals( - Object.keys(files).sort(), - ["file:///foo.ts.js", "file:///foo.ts.js.map"], - ); - assert(!files["file:///foo.ts.js"].includes("This is JSDoc")); + const keys = Object.keys(files).sort(); + assert(keys[0].endsWith("/foo.ts.js")); + assert(keys[1].endsWith("/foo.ts.js.map")); + assert(!files[keys[0]].includes("This is JSDoc")); }, }); @@ -245,10 +243,9 @@ Deno.test({ }, ); assertEquals(diagnostics.length, 1); - assertEquals( - Object.keys(files).sort(), - ["file:///foo.ts.js", "file:///foo.ts.js.map"], - ); + const keys = Object.keys(files).sort(); + assert(keys[0].endsWith("/foo.ts.js")); + assert(keys[1].endsWith("/foo.ts.js.map")); }, });