Skip to content

Commit

Permalink
tests: enable specs::run::package_json::invalid_value (#25826)
Browse files Browse the repository at this point in the history
Towards #25241

Co-authored-by: David Sherret <[email protected]>
  • Loading branch information
satyarohith and dsherret authored Oct 3, 2024
1 parent e41df20 commit 779a98c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 15 deletions.
49 changes: 40 additions & 9 deletions tests/specs/run/package_json/invalid_value/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -1,23 +1,54 @@
{
"tempDir": true,
// TODO(2.0): update the tests, should probably run install first
"ignore": true,
"tests": {
// should run fine when not referencing a failing dep entry
"run_ok": {
"args": "run ok.ts",
"run_ok_auto": {
"args": "run --quiet --node-modules-dir=auto ok.ts",
"output": "ok.ts.out"
},
"run_ok_byonm": {
"steps": [
{
"args": "install",
"output": "install.out"
},
{
"args": "run ok.ts",
"output": "ok.ts.out"
}
]
},
// should fail when referencing a failing dep entry
"run_error": {
"args": "run error.ts",
"run_error_auto": {
"args": "run --node-modules-dir=auto error.ts",
"exitCode": 1,
"output": "error.ts.out"
"output": "error_auto.out"
},
"run_error_byonm": {
"steps": [
{
"args": "install",
"output": "install.out"
},
{
"args": "run error.ts",
"exitCode": 1,
"output": "error.out"
}
]
},
// should output a warning about the failing dep entry
"task_test": {
"args": "task test",
"output": "task.out"
"steps": [
{
"args": "install",
"output": "install.out"
},
{
"args": "task test",
"output": "task.out"
}
]
}
}
}
2 changes: 2 additions & 0 deletions tests/specs/run/package_json/invalid_value/error.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: Could not resolve "@denotest/cjs-default-export", but found it in a package.json. Deno expects the node_modules/ directory to be up to date. Did you forget to run `deno install`?
at file:///[WILDCARD]/error.ts:2:23
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/[email protected]
error: Invalid version requirement
0: Unexpected character.
invalid stuff that won't parse
Expand Down
3 changes: 3 additions & 0 deletions tests/specs/run/package_json/invalid_value/install.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/[email protected]
3 changes: 0 additions & 3 deletions tests/specs/run/package_json/invalid_value/ok.ts.out
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/[email protected]
2
3 changes: 0 additions & 3 deletions tests/specs/run/package_json/invalid_value/task.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
Download http://localhost:4260/@denotest/esm-basic
Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
Initialize @denotest/[email protected]
Task test echo 1
1

0 comments on commit 779a98c

Please sign in to comment.