diff options
Diffstat (limited to 'tests/testdata/npm/cjs_sub_path')
-rw-r--r-- | tests/testdata/npm/cjs_sub_path/main.js | 21 | ||||
-rw-r--r-- | tests/testdata/npm/cjs_sub_path/main.out | 35 |
2 files changed, 56 insertions, 0 deletions
diff --git a/tests/testdata/npm/cjs_sub_path/main.js b/tests/testdata/npm/cjs_sub_path/main.js new file mode 100644 index 000000000..b71360959 --- /dev/null +++ b/tests/testdata/npm/cjs_sub_path/main.js @@ -0,0 +1,21 @@ +// this package will require a subpath like "ajv/dist/compile/codegen" +// and also get the parent directory index.js file using require("..") +import Ajv from "npm:ajv@~8.11"; +import addFormats from "npm:ajv-formats@2.1.1"; +import { expect } from "npm:chai@4.3"; + +const ajv = new Ajv(); +addFormats(ajv); + +const schema = { + type: "string", + format: "date", + formatMinimum: "2016-02-06", + formatExclusiveMaximum: "2016-12-27", +}; +const validate = ajv.compile(schema); + +expect(validate("2016-02-06")).to.be.true; +expect(validate("2016-02-05")).to.be.false; + +console.log("Fini"); diff --git a/tests/testdata/npm/cjs_sub_path/main.out b/tests/testdata/npm/cjs_sub_path/main.out new file mode 100644 index 000000000..34ec9d63f --- /dev/null +++ b/tests/testdata/npm/cjs_sub_path/main.out @@ -0,0 +1,35 @@ +[UNORDERED_START] +Download http://localhost:4545/npm/registry/ajv +Download http://localhost:4545/npm/registry/ajv-formats +Download http://localhost:4545/npm/registry/chai +Download http://localhost:4545/npm/registry/fast-deep-equal +Download http://localhost:4545/npm/registry/json-schema-traverse +Download http://localhost:4545/npm/registry/require-from-string +Download http://localhost:4545/npm/registry/uri-js +Download http://localhost:4545/npm/registry/assertion-error +Download http://localhost:4545/npm/registry/check-error +Download http://localhost:4545/npm/registry/deep-eql +Download http://localhost:4545/npm/registry/get-func-name +Download http://localhost:4545/npm/registry/loupe +Download http://localhost:4545/npm/registry/pathval +Download http://localhost:4545/npm/registry/type-detect +Download http://localhost:4545/npm/registry/punycode +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4545/npm/registry/ajv/ajv-8.11.0.tgz +Download http://localhost:4545/npm/registry/ajv-formats/ajv-formats-2.1.1.tgz +Download http://localhost:4545/npm/registry/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4545/npm/registry/chai/chai-4.3.6.tgz +Download http://localhost:4545/npm/registry/check-error/check-error-1.0.2.tgz +Download http://localhost:4545/npm/registry/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4545/npm/registry/fast-deep-equal/fast-deep-equal-3.1.3.tgz +Download http://localhost:4545/npm/registry/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4545/npm/registry/json-schema-traverse/json-schema-traverse-1.0.0.tgz +Download http://localhost:4545/npm/registry/loupe/loupe-2.3.4.tgz +Download http://localhost:4545/npm/registry/pathval/pathval-1.1.1.tgz +Download http://localhost:4545/npm/registry/punycode/punycode-2.1.1.tgz +Download http://localhost:4545/npm/registry/require-from-string/require-from-string-2.0.2.tgz +Download http://localhost:4545/npm/registry/type-detect/type-detect-4.0.8.tgz +Download http://localhost:4545/npm/registry/uri-js/uri-js-4.4.1.tgz +[UNORDERED_END] +Fini |