From 87f80ff6be5e2a132b583a9c380fff5db3cb2b07 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 20 Aug 2022 11:31:33 -0400 Subject: feat(unstable): initial support for npm specifiers (#15484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/tests/testdata/npm/cjs_with_deps/main.js | 12 ++++++++++++ cli/tests/testdata/npm/cjs_with_deps/main.out | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 cli/tests/testdata/npm/cjs_with_deps/main.js create mode 100644 cli/tests/testdata/npm/cjs_with_deps/main.out (limited to 'cli/tests/testdata/npm/cjs_with_deps') diff --git a/cli/tests/testdata/npm/cjs_with_deps/main.js b/cli/tests/testdata/npm/cjs_with_deps/main.js new file mode 100644 index 000000000..420136c92 --- /dev/null +++ b/cli/tests/testdata/npm/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.2"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/cli/tests/testdata/npm/cjs_with_deps/main.out b/cli/tests/testdata/npm/cjs_with_deps/main.out new file mode 100644 index 000000000..ad31742d9 --- /dev/null +++ b/cli/tests/testdata/npm/cjs_with_deps/main.out @@ -0,0 +1,15 @@ +Download http://localhost:4545/npm/registry/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4545/npm/registry/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4545/npm/registry/chai/chai-4.3.6.tgz +Download http://localhost:4545/npm/registry/chalk/chalk-4.1.2.tgz +Download http://localhost:4545/npm/registry/check-error/check-error-1.0.2.tgz +Download http://localhost:4545/npm/registry/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4545/npm/registry/color-name/color-name-1.1.4.tgz +Download http://localhost:4545/npm/registry/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4545/npm/registry/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4545/npm/registry/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4545/npm/registry/loupe/loupe-2.3.4.tgz +Download http://localhost:4545/npm/registry/pathval/pathval-1.1.1.tgz +Download http://localhost:4545/npm/registry/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4545/npm/registry/type-detect/type-detect-4.0.8.tgz +chalk cjs loads -- cgit v1.2.3