From 3f22f912ec4996fecb05ba6d5baa1a02bdffe78e Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 25 Oct 2022 13:18:54 -0400 Subject: [PATCH] chore: fix flaky esm_module_deno_test test (#16419) --- cli/tests/testdata/npm/esm/main.js | 4 +++- cli/tests/testdata/npm/esm/test.out | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/tests/testdata/npm/esm/main.js b/cli/tests/testdata/npm/esm/main.js index 3dfa8122ae..0f1fa25901 100644 --- a/cli/tests/testdata/npm/esm/main.js +++ b/cli/tests/testdata/npm/esm/main.js @@ -1,6 +1,8 @@ import chalk from "npm:chalk@5"; -console.log(chalk.green("chalk esm loads")); +if (import.meta.main) { + console.log(chalk.green("chalk esm loads")); +} export function test(value) { return chalk.red(value); diff --git a/cli/tests/testdata/npm/esm/test.out b/cli/tests/testdata/npm/esm/test.out index 2c1179bd1d..b3115e79f4 100644 --- a/cli/tests/testdata/npm/esm/test.out +++ b/cli/tests/testdata/npm/esm/test.out @@ -1,7 +1,6 @@ Download http://localhost:4545/npm/registry/chalk Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz Check [WILDCARD]/std/node/module_all.ts -chalk esm loads running 1 test from ./npm/esm/test.js test ... ------- output -------