diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-09-04 13:06:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 13:06:16 -0700 |
commit | c32d692a8f37c50fd700bb320571f76a107a44c2 (patch) | |
tree | 3a94f358db8ea390a35e742495848c4b69288fba /tests | |
parent | e27a19c02c537626d7874f7521f4e39d6dfad0af (diff) |
feat(install): deno install with entrypoint (#25411)
```
deno install --entrypoint one.ts two.ts
```
effectively equivalent to `deno cache`
Diffstat (limited to 'tests')
6 files changed, 58 insertions, 0 deletions
diff --git a/tests/specs/install/install_entrypoint/__test__.jsonc b/tests/specs/install/install_entrypoint/__test__.jsonc new file mode 100644 index 000000000..1afe195e2 --- /dev/null +++ b/tests/specs/install/install_entrypoint/__test__.jsonc @@ -0,0 +1,21 @@ +{ + "tempDir": true, + "tests": { + "basic": { + "steps": [ + { + "args": "install --entrypoint main.ts second.ts", + "output": "install.out" + } + ] + }, + "allow_scripts": { + "steps": [ + { + "args": "install --allow-scripts --node-modules-dir=auto --entrypoint lifecycle.ts", + "output": "lifecycle.out" + } + ] + } + } +} diff --git a/tests/specs/install/install_entrypoint/install.out b/tests/specs/install/install_entrypoint/install.out new file mode 100644 index 000000000..d702cf45a --- /dev/null +++ b/tests/specs/install/install_entrypoint/install.out @@ -0,0 +1,7 @@ +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://localhost:4260/@denotest/esm-basic +Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz +[UNORDERED_END] diff --git a/tests/specs/install/install_entrypoint/lifecycle.out b/tests/specs/install/install_entrypoint/lifecycle.out new file mode 100644 index 000000000..8eae8ee12 --- /dev/null +++ b/tests/specs/install/install_entrypoint/lifecycle.out @@ -0,0 +1,22 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/node-lifecycle-scripts +Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest/node-lifecycle-scripts/1.0.0.tgz +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Initialize @denotest/node-lifecycle-scripts@1.0.0 +Initialize @denotest/bin@1.0.0 +[UNORDERED_END] +preinstall +deno preinstall.js +node preinstall.js +install +hello from install script +postinstall[WILDCARD] + _____________ +< postinstall > + ------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/tests/specs/install/install_entrypoint/lifecycle.ts b/tests/specs/install/install_entrypoint/lifecycle.ts new file mode 100644 index 000000000..e9fb2cf9c --- /dev/null +++ b/tests/specs/install/install_entrypoint/lifecycle.ts @@ -0,0 +1,3 @@ +import { value } from "npm:@denotest/node-lifecycle-scripts"; + +console.log(`value is ${value}`); diff --git a/tests/specs/install/install_entrypoint/main.ts b/tests/specs/install/install_entrypoint/main.ts new file mode 100644 index 000000000..aceb2b3c8 --- /dev/null +++ b/tests/specs/install/install_entrypoint/main.ts @@ -0,0 +1,4 @@ +import { getValue, setValue } from "npm:@denotest/esm-basic"; + +setValue(5); +console.log(getValue()); diff --git a/tests/specs/install/install_entrypoint/second.ts b/tests/specs/install/install_entrypoint/second.ts new file mode 100644 index 000000000..2c781286f --- /dev/null +++ b/tests/specs/install/install_entrypoint/second.ts @@ -0,0 +1 @@ +import { add } from "jsr:@denotest/add@1.0.0"; |