summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/specs/install/install_entrypoint/__test__.jsonc21
-rw-r--r--tests/specs/install/install_entrypoint/install.out7
-rw-r--r--tests/specs/install/install_entrypoint/lifecycle.out22
-rw-r--r--tests/specs/install/install_entrypoint/lifecycle.ts3
-rw-r--r--tests/specs/install/install_entrypoint/main.ts4
-rw-r--r--tests/specs/install/install_entrypoint/second.ts1
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";