diff options
Diffstat (limited to 'cli/tests/testdata/package_json')
6 files changed, 32 insertions, 0 deletions
diff --git a/cli/tests/testdata/package_json/invalid_value/error.ts b/cli/tests/testdata/package_json/invalid_value/error.ts new file mode 100644 index 000000000..fd75d633c --- /dev/null +++ b/cli/tests/testdata/package_json/invalid_value/error.ts @@ -0,0 +1,4 @@ +// the package.json will error when importing +import * as test from "@denotest/cjs-default-export"; + +console.log(test); diff --git a/cli/tests/testdata/package_json/invalid_value/error.ts.out b/cli/tests/testdata/package_json/invalid_value/error.ts.out new file mode 100644 index 000000000..866388e60 --- /dev/null +++ b/cli/tests/testdata/package_json/invalid_value/error.ts.out @@ -0,0 +1,6 @@ +error: Parsing version constraints in the application-level package.json is more strict at the moment. + +Invalid npm specifier version requirement. Unexpected character. + invalid stuff that won't parse + ~ + at file:///[WILDCARD]/error.ts:2:23 diff --git a/cli/tests/testdata/package_json/invalid_value/ok.ts b/cli/tests/testdata/package_json/invalid_value/ok.ts new file mode 100644 index 000000000..ce517439f --- /dev/null +++ b/cli/tests/testdata/package_json/invalid_value/ok.ts @@ -0,0 +1,4 @@ +import * as test from "@denotest/esm-basic"; + +test.setValue(2); +console.log(test.getValue()); diff --git a/cli/tests/testdata/package_json/invalid_value/ok.ts.out b/cli/tests/testdata/package_json/invalid_value/ok.ts.out new file mode 100644 index 000000000..3c7e2792f --- /dev/null +++ b/cli/tests/testdata/package_json/invalid_value/ok.ts.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/npm/registry/@denotest/esm-basic +Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz +2 diff --git a/cli/tests/testdata/package_json/invalid_value/package.json b/cli/tests/testdata/package_json/invalid_value/package.json new file mode 100644 index 000000000..c8857649e --- /dev/null +++ b/cli/tests/testdata/package_json/invalid_value/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "test": "echo 1" + }, + "dependencies": { + "@denotest/esm-basic": "*", + "@denotest/cjs-default-export": "invalid stuff that won't parse" + } +} diff --git a/cli/tests/testdata/package_json/invalid_value/task.out b/cli/tests/testdata/package_json/invalid_value/task.out new file mode 100644 index 000000000..914dc27c6 --- /dev/null +++ b/cli/tests/testdata/package_json/invalid_value/task.out @@ -0,0 +1,6 @@ +Warning Ignoring dependency '@denotest/cjs-default-export' in package.json because its version requirement failed to parse: Invalid npm specifier version requirement. Unexpected character. + invalid stuff that won't parse + ~ +Warning Currently only basic package.json `scripts` are supported. Programs like `rimraf` or `cross-env` will not work correctly. This will be fixed in the upcoming release. +Task test echo 1 +1 |