diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-17 17:38:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 17:38:50 -0400 |
commit | 41f618a1df6bb8c66d7968ac64456139b9f4c197 (patch) | |
tree | dbcc67e009cf70099be82ea3774669e8aefc6023 /cli/tests/testdata/npm/registry/@denotest/binary-package/1.0.0/index.js | |
parent | ad223362451688c13a4441563210f58bdb046a78 (diff) |
fix(npm): improved optional dependency support (#19135)
Note: If the package information has already been cached, then this
requires running with `--reload` or for the registry information to be
fetched some other way (ex. the cache busting).
Closes #15544
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/testdata/npm/registry/@denotest/binary-package/1.0.0/index.js')
-rw-r--r-- | cli/tests/testdata/npm/registry/@denotest/binary-package/1.0.0/index.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/registry/@denotest/binary-package/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/binary-package/1.0.0/index.js new file mode 100644 index 000000000..5870118e7 --- /dev/null +++ b/cli/tests/testdata/npm/registry/@denotest/binary-package/1.0.0/index.js @@ -0,0 +1,13 @@ +const packageByOs = { + "darwin": "@denotest/binary-package-mac", + "linux": "@denotest/binary-package-linux", + "win32": "@denotest/binary-package-windows", +} + +const selectedPackage = packageByOs[process.platform]; + +if (!selectedPackage) { + throw new Error("trying to run on unsupported platform"); +} + +require(selectedPackage);
\ No newline at end of file |