diff --git a/demo.jsonc b/demo.jsonc deleted file mode 100644 index 84b1138..0000000 --- a/demo.jsonc +++ /dev/null @@ -1,57 +0,0 @@ -{ - "+tasks": { - "start": { - "description": "🍱 Start application", - "task": "deno run mod.ts", - "deno": { - "run": { // For "deno run" subcommand - "unstable": true, // ➡️ --unstable - "permissions": { - "prompt": false, // ➡️ --no-prompt - "read": true, // ➡️ --allow-read - "run": false, // ➡️ --deny-run - "net": [ // ➡️ --allow-net=https://deno.land,https://example.com - "https://deno.land", - "https://example.com" - ], - "write": { // ➡️ --allow-write=/tmp --deny-write=/root - "allow": [ - "/tmp" - ], - "deny": [ - "/root" - ] - } - } - } - }, - // Configure environment variables - "env": { - "FOO": true, // ➡️ Inherit FOO environment variable - "BAR": "bar" // ➡️ Set BAR environment variable to "bar" - } - }, - // Write "multi-line" tasks using arrays (they will be joined with "\n") - "test": { - "description": "🧪 Run tests and print collected coverage", - "task": [ - "rm -rf .coverage &&", - "deno test &&", - "deno coverage .coverage" - ], - "deno": { - "test": { // For "deno test" subcommand - "unstable": true, // ➡️ --unstable - "permissions": { // ➡️ --allow-all - "all": true - }, - "coverage": ".coverage", // ➡️ --coverage=.coverage - "parallel": true // ➡️ --parallel - }, - "coverage": { // For "deno coverage" subcommand - "quiet": true // ➡️ --quiet - } - } - } - } -} diff --git a/deno.lock b/deno.lock index d6af86e..c02867e 100644 --- a/deno.lock +++ b/deno.lock @@ -178,9 +178,91 @@ "https://deno.land/std@0.205.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", "https://deno.land/std@0.205.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", "https://deno.land/std@0.205.0/fmt/colors.ts": "c51c4642678eb690dcf5ffee5918b675bf01a33fba82acf303701ae1a4f8c8d9", + "https://deno.land/std@0.205.0/fs/_util.ts": "fbf57dcdc9f7bc8128d60301eece608246971a7836a3bb1e78da75314f08b978", + "https://deno.land/std@0.205.0/fs/copy.ts": "ca19e4837965914471df38fbd61e16f9e8adfe89f9cffb0c83615c83ea3fc2bf", + "https://deno.land/std@0.205.0/fs/empty_dir.ts": "0b4a2508232446eed232ad1243dd4b0f07ac503a281633ae1324d1528df70964", + "https://deno.land/std@0.205.0/fs/ensure_dir.ts": "dc64c4c75c64721d4e3fb681f1382f803ff3d2868f08563ff923fdd20d071c40", + "https://deno.land/std@0.205.0/fs/ensure_file.ts": "39ac83cc283a20ec2735e956adf5de3e8a3334e0b6820547b5772f71c49ae083", + "https://deno.land/std@0.205.0/fs/ensure_link.ts": "c15e69c48556d78aae31b83e0c0ece04b7b8bc0951412f5b759aceb6fde7f0ac", + "https://deno.land/std@0.205.0/fs/ensure_symlink.ts": "b389c8568f0656d145ac7ece472afe710815cccbb2ebfd19da7978379ae143fe", + "https://deno.land/std@0.205.0/fs/eol.ts": "f1f2eb348a750c34500741987b21d65607f352cf7205f48f4319d417fff42842", + "https://deno.land/std@0.205.0/fs/exists.ts": "cb59a853d84871d87acab0e7936a4dac11282957f8e195102c5a7acb42546bb8", + "https://deno.land/std@0.205.0/fs/expand_glob.ts": "4f98c508fc9e40d6311d2f7fd88aaad05235cc506388c22dda315e095305811d", + "https://deno.land/std@0.205.0/fs/mod.ts": "bc3d0acd488cc7b42627044caf47d72019846d459279544e1934418955ba4898", + "https://deno.land/std@0.205.0/fs/move.ts": "b4f8f46730b40c32ea3c0bc8eb0fd0e8139249a698883c7b3756424cf19785c9", + "https://deno.land/std@0.205.0/fs/walk.ts": "c1e6b43f72a46e89b630140308bd51a4795d416a416b4cfb7cd4bd1e25946723", "https://deno.land/std@0.205.0/json/common.ts": "ecd5e87d45b5f0df33238ed8b1746e1444da7f5c86ae53d0f0b04280f41a25bb", "https://deno.land/std@0.205.0/jsonc/mod.ts": "b88dce28eb3645667caa856538ae2fe87af51410822544a0b45a4177ef3bd7dd", "https://deno.land/std@0.205.0/jsonc/parse.ts": "c1096e2b7ffb4996d7ed841dfdb29a4fccc78edcc55299beaa20d6fe5facf7b6", + "https://deno.land/std@0.205.0/path/_common/assert_path.ts": "061e4d093d4ba5aebceb2c4da3318bfe3289e868570e9d3a8e327d91c2958946", + "https://deno.land/std@0.205.0/path/_common/basename.ts": "0d978ff818f339cd3b1d09dc914881f4d15617432ae519c1b8fdc09ff8d3789a", + "https://deno.land/std@0.205.0/path/_common/common.ts": "9e4233b2eeb50f8b2ae10ecc2108f58583aea6fd3e8907827020282dc2b76143", + "https://deno.land/std@0.205.0/path/_common/constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", + "https://deno.land/std@0.205.0/path/_common/dirname.ts": "2ba7fb4cc9fafb0f38028f434179579ce61d4d9e51296fad22b701c3d3cd7397", + "https://deno.land/std@0.205.0/path/_common/format.ts": "11aa62e316dfbf22c126917f5e03ea5fe2ee707386555a8f513d27ad5756cf96", + "https://deno.land/std@0.205.0/path/_common/from_file_url.ts": "ef1bf3197d2efbf0297a2bdbf3a61d804b18f2bcce45548ae112313ec5be3c22", + "https://deno.land/std@0.205.0/path/_common/glob_to_reg_exp.ts": "5c3c2b79fc2294ec803d102bd9855c451c150021f452046312819fbb6d4dc156", + "https://deno.land/std@0.205.0/path/_common/is_glob.ts": "567dce5c6656bdedfc6b3ee6c0833e1e4db2b8dff6e62148e94a917f289c06ad", + "https://deno.land/std@0.205.0/path/_common/normalize.ts": "2ba7fb4cc9fafb0f38028f434179579ce61d4d9e51296fad22b701c3d3cd7397", + "https://deno.land/std@0.205.0/path/_common/normalize_string.ts": "88c472f28ae49525f9fe82de8c8816d93442d46a30d6bb5063b07ff8a89ff589", + "https://deno.land/std@0.205.0/path/_common/relative.ts": "1af19d787a2a84b8c534cc487424fe101f614982ae4851382c978ab2216186b4", + "https://deno.land/std@0.205.0/path/_common/strip_trailing_separators.ts": "7ffc7c287e97bdeeee31b155828686967f222cd73f9e5780bfe7dfb1b58c6c65", + "https://deno.land/std@0.205.0/path/_common/to_file_url.ts": "a8cdd1633bc9175b7eebd3613266d7c0b6ae0fb0cff24120b6092ac31662f9ae", + "https://deno.land/std@0.205.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", + "https://deno.land/std@0.205.0/path/_os.ts": "30b0c2875f360c9296dbe6b7f2d528f0f9c741cecad2e97f803f5219e91b40a2", + "https://deno.land/std@0.205.0/path/basename.ts": "04bb5ef3e86bba8a35603b8f3b69537112cdd19ce64b77f2522006da2977a5f3", + "https://deno.land/std@0.205.0/path/common.ts": "f4d061c7d0b95a65c2a1a52439edec393e906b40f1caf4604c389fae7caa80f5", + "https://deno.land/std@0.205.0/path/dirname.ts": "88a0a71c21debafc4da7a4cd44fd32e899462df458fbca152390887d41c40361", + "https://deno.land/std@0.205.0/path/extname.ts": "2da4e2490f3b48b7121d19fb4c91681a5e11bd6bd99df4f6f47d7a71bb6ecdf2", + "https://deno.land/std@0.205.0/path/format.ts": "3457530cc85d1b4bab175f9ae73998b34fd456c830d01883169af0681b8894fb", + "https://deno.land/std@0.205.0/path/from_file_url.ts": "e7fa233ea1dff9641e8d566153a24d95010110185a6f418dd2e32320926043f8", + "https://deno.land/std@0.205.0/path/glob.ts": "9c77cf47db1d786e2ebf66670824d03fd84ecc7c807cac24441eb9d5cb6a2986", + "https://deno.land/std@0.205.0/path/is_absolute.ts": "67232b41b860571c5b7537f4954c88d86ae2ba45e883ee37d3dec27b74909d13", + "https://deno.land/std@0.205.0/path/join.ts": "98d3d76c819af4a11a81d5ba2dbb319f1ce9d63fc2b615597d4bcfddd4a89a09", + "https://deno.land/std@0.205.0/path/mod.ts": "2d62a0a8b78a60e8e6f485d881bac6b61d58573b11cf585fb7c8fc50d9b20d80", + "https://deno.land/std@0.205.0/path/normalize.ts": "aa95be9a92c7bd4f9dc0ba51e942a1973e2b93d266cd74f5ca751c136d520b66", + "https://deno.land/std@0.205.0/path/parse.ts": "d87ff0deef3fb495bc0d862278ff96da5a06acf0625ca27769fc52ac0d3d6ece", + "https://deno.land/std@0.205.0/path/posix/_util.ts": "ecf49560fedd7dd376c6156cc5565cad97c1abe9824f4417adebc7acc36c93e5", + "https://deno.land/std@0.205.0/path/posix/basename.ts": "a630aeb8fd8e27356b1823b9dedd505e30085015407caa3396332752f6b8406a", + "https://deno.land/std@0.205.0/path/posix/common.ts": "e781d395dc76f6282e3f7dd8de13194abb8b04a82d109593141abc6e95755c8b", + "https://deno.land/std@0.205.0/path/posix/dirname.ts": "f48c9c42cc670803b505478b7ef162c7cfa9d8e751b59d278b2ec59470531472", + "https://deno.land/std@0.205.0/path/posix/extname.ts": "ee7f6571a9c0a37f9218fbf510c440d1685a7c13082c348d701396cc795e0be0", + "https://deno.land/std@0.205.0/path/posix/format.ts": "b94876f77e61bfe1f147d5ccb46a920636cd3cef8be43df330f0052b03875968", + "https://deno.land/std@0.205.0/path/posix/from_file_url.ts": "b97287a83e6407ac27bdf3ab621db3fccbf1c27df0a1b1f20e1e1b5acf38a379", + "https://deno.land/std@0.205.0/path/posix/glob.ts": "86c3f06d1c98303613c74650961c3e24bdb871cde2a97c3ae7f0f6d4abbef445", + "https://deno.land/std@0.205.0/path/posix/is_absolute.ts": "159900a3422d11069d48395568217eb7fc105ceda2683d03d9b7c0f0769e01b8", + "https://deno.land/std@0.205.0/path/posix/join.ts": "0c0d84bdc344876930126640011ec1b888e6facf74153ffad9ef26813aa2a076", + "https://deno.land/std@0.205.0/path/posix/mod.ts": "6bfa8a42d85345b12dbe8571028ca2c62d460b6ef968125e498602b43b6cf6b6", + "https://deno.land/std@0.205.0/path/posix/normalize.ts": "11de90a94ab7148cc46e5a288f7d732aade1d616bc8c862f5560fa18ff987b4b", + "https://deno.land/std@0.205.0/path/posix/parse.ts": "199208f373dd93a792e9c585352bfc73a6293411bed6da6d3bc4f4ef90b04c8e", + "https://deno.land/std@0.205.0/path/posix/relative.ts": "e2f230608b0f083e6deaa06e063943e5accb3320c28aef8d87528fbb7fe6504c", + "https://deno.land/std@0.205.0/path/posix/resolve.ts": "51579d83159d5c719518c9ae50812a63959bbcb7561d79acbdb2c3682236e285", + "https://deno.land/std@0.205.0/path/posix/separator.ts": "0b6573b5f3269a3164d8edc9cefc33a02dd51003731c561008c8bb60220ebac1", + "https://deno.land/std@0.205.0/path/posix/to_file_url.ts": "08d43ea839ee75e9b8b1538376cfe95911070a655cd312bc9a00f88ef14967b6", + "https://deno.land/std@0.205.0/path/posix/to_namespaced_path.ts": "c9228a0e74fd37e76622cd7b142b8416663a9b87db643302fa0926b5a5c83bdc", + "https://deno.land/std@0.205.0/path/relative.ts": "23d45ede8b7ac464a8299663a43488aad6b561414e7cbbe4790775590db6349c", + "https://deno.land/std@0.205.0/path/resolve.ts": "5b184efc87155a0af9fa305ff68a109e28de9aee81fc3e77cd01380f19daf867", + "https://deno.land/std@0.205.0/path/separator.ts": "40a3e9a4ad10bef23bc2cd6c610291b6c502a06237c2c4cd034a15ca78dedc1f", + "https://deno.land/std@0.205.0/path/to_file_url.ts": "edaafa089e0bce386e1b2d47afe7c72e379ff93b28a5829a5885e4b6c626d864", + "https://deno.land/std@0.205.0/path/to_namespaced_path.ts": "cf8734848aac3c7527d1689d2adf82132b1618eff3cc523a775068847416b22a", + "https://deno.land/std@0.205.0/path/windows/_util.ts": "f32b9444554c8863b9b4814025c700492a2b57ff2369d015360970a1b1099d54", + "https://deno.land/std@0.205.0/path/windows/basename.ts": "8a9dbf7353d50afbc5b221af36c02a72c2d1b2b5b9f7c65bf6a5a2a0baf88ad3", + "https://deno.land/std@0.205.0/path/windows/common.ts": "e781d395dc76f6282e3f7dd8de13194abb8b04a82d109593141abc6e95755c8b", + "https://deno.land/std@0.205.0/path/windows/dirname.ts": "5c2aa541384bf0bd9aca821275d2a8690e8238fa846198ef5c7515ce31a01a94", + "https://deno.land/std@0.205.0/path/windows/extname.ts": "07f4fa1b40d06a827446b3e3bcc8d619c5546b079b8ed0c77040bbef716c7614", + "https://deno.land/std@0.205.0/path/windows/format.ts": "343019130d78f172a5c49fdc7e64686a7faf41553268961e7b6c92a6d6548edf", + "https://deno.land/std@0.205.0/path/windows/from_file_url.ts": "d53335c12b0725893d768be3ac6bf0112cc5b639d2deb0171b35988493b46199", + "https://deno.land/std@0.205.0/path/windows/glob.ts": "0286fb89ecd21db5cbf3b6c79e2b87c889b03f1311e66fb769e6b905d4142332", + "https://deno.land/std@0.205.0/path/windows/is_absolute.ts": "245b56b5f355ede8664bd7f080c910a97e2169972d23075554ae14d73722c53c", + "https://deno.land/std@0.205.0/path/windows/join.ts": "e6600bf88edeeef4e2276e155b8de1d5dec0435fd526ba2dc4d37986b2882f16", + "https://deno.land/std@0.205.0/path/windows/mod.ts": "c3d1a36fbf9f6db1320bcb4fbda8de011d25461be3497105e15cbea1e3726198", + "https://deno.land/std@0.205.0/path/windows/normalize.ts": "9deebbf40c81ef540b7b945d4ccd7a6a2c5a5992f791e6d3377043031e164e69", + "https://deno.land/std@0.205.0/path/windows/parse.ts": "120faf778fe1f22056f33ded069b68e12447668fcfa19540c0129561428d3ae5", + "https://deno.land/std@0.205.0/path/windows/relative.ts": "026855cd2c36c8f28f1df3c6fbd8f2449a2aa21f48797a74700c5d872b86d649", + "https://deno.land/std@0.205.0/path/windows/resolve.ts": "5ff441ab18a2346abadf778121128ee71bda4d0898513d4639a6ca04edca366b", + "https://deno.land/std@0.205.0/path/windows/separator.ts": "ae21f27015f10510ed1ac4a0ba9c4c9c967cbdd9d9e776a3e4967553c397bd5d", + "https://deno.land/std@0.205.0/path/windows/to_file_url.ts": "8e9ea9e1ff364aa06fa72999204229952d0a279dbb876b7b838b2b2fea55cce3", + "https://deno.land/std@0.205.0/path/windows/to_namespaced_path.ts": "e0f4d4a5e77f28a5708c1a33ff24360f35637ba6d8f103d19661255ef7bfd50d", "https://deno.land/x/zod@v3.21.4/ZodError.ts": "4de18ff525e75a0315f2c12066b77b5c2ae18c7c15ef7df7e165d63536fdf2ea", "https://deno.land/x/zod@v3.21.4/errors.ts": "5285922d2be9700cc0c70c95e4858952b07ae193aa0224be3cbd5cd5567eabef", "https://deno.land/x/zod@v3.21.4/external.ts": "a6cfbd61e9e097d5f42f8a7ed6f92f93f51ff927d29c9fbaec04f03cbce130fe", diff --git a/mod.ts b/mod.ts index 8690422..304a667 100644 --- a/mod.ts +++ b/mod.ts @@ -175,8 +175,8 @@ const watch = is.union([ is.boolean().transform((v) => v ? "--watch" : ""), is.array(is.string()).transform((v) => v.length ? `--watch='${v.join(",")}'` : ""), is.object({ - files: is.array(is.string()).transform((v) => v.length ? `--watch='${v.join(",")}'` : ""), - clearScreen: is.boolean().transform((v) => v === false ? "--no-clear-screen" : ""), + files: is.array(is.string()).optional().transform((v) => v?.length ? `--watch='${v.join(",")}'` : ""), + clearScreen: is.boolean().optional().transform((v) => v === false ? "--no-clear-screen" : ""), }), ]).optional().transform((v) => Object.values(v ?? {}).filter(Boolean).join(" ")) @@ -313,7 +313,7 @@ const test = common.merge(runnable).extend({ doc: is.boolean().optional().transform((v) => v ? "--doc" : ""), traceOps: is.boolean().optional().transform((v) => v ? "--trace-ops" : ""), run: is.boolean().optional().transform((v) => v === false ? "--no-run" : ""), - allowNone: is.boolean().optional().transform((v) => v === true ? "--allow-none" : ""), + allowNone: is.boolean().optional().transform((v) => v ? "--allow-none" : ""), failFast: is.union([ is.boolean().transform((v) => v ? "--fail-fast" : ""), is.number().transform((v) => `--fail-fast=${v}`), diff --git a/mod_test.ts b/mod_test.ts index 5a8d5b7..fe4fd8d 100644 --- a/mod_test.ts +++ b/mod_test.ts @@ -1,6 +1,6 @@ import { make } from "./mod.ts" -import { expandGlob } from "https://deno.land/std@0.204.0/fs/mod.ts" -import * as JSONC from "https://deno.land/std@0.203.0/jsonc/mod.ts" +import { expandGlob } from "https://deno.land/std@0.205.0/fs/mod.ts" +import * as JSONC from "https://deno.land/std@0.205.0/jsonc/mod.ts" import { expect } from "https://esm.sh/chai@4.3.10?pin=v133" for await (const { path, name: _name } of expandGlob("tests/*.jsonc")) { @@ -29,11 +29,6 @@ for await (const { path, name: _name } of expandGlob("tests/*.jsonc")) { } } -/*Deno.test("deno task make: exit code", async () => { - const {code} = await make({task:"make", config:"tests/deno_make.jsonc", log:() => null, exit:true}) - expect(code).to.equal(1) -})*/ - Deno.test("deno task make: print tasks", async () => { const stdio = [] as string[] const { code } = await make({ config: "tests/deno_make.jsonc", log: (message) => stdio.push(message), exit: false }) @@ -41,6 +36,28 @@ Deno.test("deno task make: print tasks", async () => { expect(code).to.equal(0) }) +Deno.test("deno task make: exit code", async () => { + const { exit } = Deno + try { + let code = 0 + Object.assign(Deno, { exit: (rc: number) => code = rc }) + await make({ task: "make:exit", config: "tests/deno_make.jsonc", exit: true, stdio: "null" }) + expect(code).to.equal(1) + } finally { + Object.assign(Deno, { exit }) + } +}) + +Deno.test("deno task make: handle removal of .deno-make.json gracefully", async () => { + const { code } = await make({ + task: "make:rm_deno_make_json", + config: "tests/deno_make.jsonc", + exit: false, + stdio: "null", + }).catch((error) => error) + expect(code).to.equal(0) +}) + Deno.test("deno task make: tasks empty", async () => { const stdio = [] as string[] const { code } = await make({ diff --git a/tests/deno_bench.jsonc b/tests/deno_bench.jsonc index 0967ef4..738ba1e 100644 --- a/tests/deno_bench.jsonc +++ b/tests/deno_bench.jsonc @@ -1 +1,26 @@ -{} +{ + "tasks": { + "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" + }, + "+tasks": { + "flags:none": { + "task": "deno bench", + "cwd": "tests", + "deno": { + "bench": {} + } + }, + "flags:bench": { + "task": "deno bench", + "cwd": "tests", + "deno": { + "bench": { + "json": true, + "run": false, + "filter": "mod_bench.ts", + "ignore": ["mod.ts"] + } + } + } + } +} diff --git a/tests/deno_bundle.jsonc b/tests/deno_bundle.jsonc index 0967ef4..7a26bca 100644 --- a/tests/deno_bundle.jsonc +++ b/tests/deno_bundle.jsonc @@ -1 +1,23 @@ -{} +{ + "tasks": { + "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" + }, + "+tasks": { + "flags:none": { + "task": "deno bundle mod.ts", + "cwd": "tests", + "deno": { + "bundle": {} + } + }, + "flags:bundle": { + "task": "deno bundle mod.ts", + "cwd": "tests", + "deno": { + "bundle": { + "ext": "js" + } + } + } + } +} diff --git a/tests/deno_cache.jsonc b/tests/deno_cache.jsonc index 66c4a14..d5c1234 100644 --- a/tests/deno_cache.jsonc +++ b/tests/deno_cache.jsonc @@ -5,7 +5,10 @@ "+tasks": { "flags:none": { "task": "deno cache mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "cache": {} + } } } } diff --git a/tests/deno_check.jsonc b/tests/deno_check.jsonc index 6afbbb2..e1cbf6e 100644 --- a/tests/deno_check.jsonc +++ b/tests/deno_check.jsonc @@ -5,9 +5,12 @@ "+tasks": { "flags:none": { "task": "deno check mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "check": {} + } }, - "flags:boolean_true": { + "flags:check": { "task": "deno check mod.ts", "cwd": "tests", "deno": { @@ -15,15 +18,6 @@ "all": true } } - }, - "flags:boolean_false": { - "task": "deno check mod.ts", - "cwd": "tests", - "deno": { - "check": { - "all": false - } - } } } } diff --git a/tests/deno_common.jsonc b/tests/deno_common.jsonc index e760597..9279782 100644 --- a/tests/deno_common.jsonc +++ b/tests/deno_common.jsonc @@ -3,51 +3,19 @@ "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" }, "+tasks": { - "flags:general:boolean": { + "flags:general": { "task": "deno help", "cwd": "tests", "deno": { "run": { "unstable": true, "quiet": true, - "certificateErrors": true - }, - "test": { - "unstable": false, - "quiet": false, - "certificateErrors": false - } - } - }, - "flags:general:string": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { + "certificateErrors": false, "importMap": "imports.json", "cert": "/dev/null", - "location": "https://deno.test" - } - } - }, - "flags:general:number": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { - "seed": 0 - } - } - }, - "flags:general:array": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { + "location": "https://deno.test", + "seed": 0, "v8Flags": ["--print-code"] - }, - "test": { - "v8Flags": [] } } }, @@ -66,7 +34,7 @@ } } }, - "flags:lock:string": { + "flags:lock_1": { "task": "deno help", "cwd": "tests", "deno": { @@ -78,35 +46,35 @@ }, "run": { "lock": "deno.lock" - } - } - }, - "flags:lock:boolean": { - "task": "deno help", - "cwd": "tests", - "deno": { - "info": { - "lock": false }, - "run": { - "lock": false - } - } - }, - "flags:lock:object": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { + "bench": { "lock": { "write": true } }, - "test": { + "bundle": { "lock": { "file": "deno.lock", "write": false } + }, + "cache": { + "lock": false + }, + "check": { + "lock": true + } + } + }, + "flags:lock_2": { + "task": "deno help", + "cwd": "tests", + "deno": { + "doc": { + "lock": true + }, + "info": { + "lock": false } } }, @@ -127,7 +95,7 @@ } } }, - "flags:permissions:boolean": { + "flags:permissions:detailed": { "task": "deno help", "cwd": "tests", "deno": { @@ -159,7 +127,7 @@ } } }, - "flags:permissions:array": { + "flags:permissions:detailed_more": { "task": "deno help", "cwd": "tests", "deno": { @@ -175,23 +143,6 @@ } }, "test": { - "permissions": { - "read": [], - "write": [], - "net": [], - "env": [], - "sys": [], - "run": [], - "ffi": [] - } - } - } - }, - "flags:permissions:allow_deny_object": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { "permissions": { "read": { "allow": ["test"], "deny": ["test"] }, "write": { "allow": ["test"], "deny": ["test"] }, @@ -202,7 +153,18 @@ "ffi": { "allow": ["test"], "deny": ["test"] } } }, - "test": { + "compile": { + "permissions": { + "read": [], + "write": [], + "net": [], + "env": [], + "sys": [], + "run": [], + "ffi": [] + } + }, + "install": { "permissions": { "read": { "allow": [], "deny": [] }, "write": { "allow": [], "deny": [] }, @@ -215,123 +177,85 @@ } } }, - "flags:modules:boolean": { + "flags:modules": { "task": "deno help", "cwd": "tests", "deno": { "run": { "modules": { "cached": true, - "remote": true, - "npm": true, + "remote": false, + "npm": false, "check": true, "reload": true, "node_modules": true, "vendor": true } }, + "bundle": { + "modules": {} + }, "test": { "modules": { - "cached": false, - "remote": false, - "npm": false, "check": false, - "reload": false, - "node_modules": false, - "vendor": false + "reload": false } - } - } - }, - "flags:modules:string": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { - "modules": { - "check": "all" - } - } - } - }, - "flags:modules:array": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { + }, + "compile": { "modules": { + "check": "all", "reload": ["npm:"] } }, - "test": { + "vendor": { "modules": { "reload": [] } } } }, - "flags:inspect:string": { + "flags:inspect": { "task": "deno help", "cwd": "tests", "deno": { "run": { "inspect": "127.0.0.1:9229" - } - } - }, - "flags:inspect:object": { - "task": "deno help", - "deno": { - "run": { - "inspect": { - "listen": "127.0.0.1:9229", - "break": "127.0.0.1:9230", - "wait:": "127.0.0.1:9231" - } }, "test": { "inspect": { + "listen": "127.0.0.1:9229", + "break": "127.0.0.1:9230", + "wait": "127.0.0.1:9231" } + }, + "repl": { + "inspect": {} } } }, - "flags:watch:boolean": { + "flags:watch": { "task": "deno help", "cwd": "tests", "deno": { "run": { "watch": true }, - "test": { + "bundle": { "watch": false - } - } - }, - "flags:watch:array": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { + }, + "test": { "watch": ["mod.ts"] }, - "test": { + "bench": { "watch": [] - } - } - }, - "flags:watch:object": { - "task": "deno help", - "cwd": "tests", - "deno": { - "run": { + }, + "fmt": { "watch": { - "files": ["mod.ts"], - "clearScreen": true + "files": ["mod.ts"] } }, - "test": { + "lint": { "watch": { - "files": [], "clearScreen": false } } diff --git a/tests/deno_compile.jsonc b/tests/deno_compile.jsonc index bec27e7..8d045cf 100644 --- a/tests/deno_compile.jsonc +++ b/tests/deno_compile.jsonc @@ -5,26 +5,18 @@ "+tasks": { "flags:none": { "task": "deno compile mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "compile": {} + } }, - "flags:case_1": { + "flags:compile": { "task": "deno compile mod.ts", "cwd": "tests", "deno": { "compile": { "include": ["mod_test.ts"], "output": ".mod.bin", - "target": "x86_64-unknown-linux-gnu" - } - } - }, - "flags:case_2": { - "task": "deno compile mod.ts", - "cwd": "tests", - "deno": { - "compile": { - "include": [], - "output": ".mod.bin", "target": "x86_64-pc-windows-msvc", "terminal": false } diff --git a/tests/deno_coverage.jsonc b/tests/deno_coverage.jsonc index 1558586..14f2f41 100644 --- a/tests/deno_coverage.jsonc +++ b/tests/deno_coverage.jsonc @@ -4,64 +4,32 @@ }, "+tasks": { "flags:none": { - "task": "deno coverage .coverage", - "cwd": "tests" - }, - "flags:boolean_true": { "task": "deno coverage .coverage", "cwd": "tests", "deno": { - "coverage": { - "lcov": true - } + "coverage": {} } }, - "flags:boolean_false": { - "task": "deno coverage .coverage", - "cwd": "tests", - "deno": { - "coverage": { - "lcov": false - } - } - }, - "flags:string": { - "task": "deno coverage .coverage", - "cwd": "tests", - "deno": { - "coverage": { - "include": "^file:", - "exclude": "(js|mjs|ts|jsx|tsx)" - } - } - }, - /*"flags:array": { - "task": "deno coverage .coverage", - "cwd": "tests", - "deno": { - "coverage": { - "ignore": ["../.coverage"] - } - } - },*/ - "flags:array_empty": { - "task": "deno coverage .coverage", - "cwd": "tests", - "deno": { - "coverage": { - "ignore": [] - } - } - }, - "flags:lcov": { + "flags:coverage": { "task": "deno coverage .coverage", "cwd": "tests", "deno": { "coverage": { "lcov": true, + "include": "^file:", + "exclude": "(js|mjs|ts|jsx|tsx)", "output": ".coverage.report" } } + }, + "flags:coverage_alt": { + "task": "deno help", + "cwd": "tests", + "deno": { + "coverage": { + "ignore": ["mod.ts"] + } + } } } } diff --git a/tests/deno_doc.jsonc b/tests/deno_doc.jsonc index a8a3937..c55e704 100644 --- a/tests/deno_doc.jsonc +++ b/tests/deno_doc.jsonc @@ -5,9 +5,12 @@ "+tasks": { "flags:none": { "task": "deno doc mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "doc": {} + } }, - "flags:boolean_true": { + "flags:doc": { "task": "deno doc mod.ts", "cwd": "tests", "deno": { @@ -16,16 +19,6 @@ "json": true } } - }, - "flags:boolean_false": { - "task": "deno doc mod.ts", - "cwd": "tests", - "deno": { - "doc": { - "private": false, - "json": false - } - } } } } diff --git a/tests/deno_eval.jsonc b/tests/deno_eval.jsonc index 0967ef4..905bfb3 100644 --- a/tests/deno_eval.jsonc +++ b/tests/deno_eval.jsonc @@ -1 +1,24 @@ -{} +{ + "tasks": { + "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" + }, + "+tasks": { + "flags:none": { + "task": "deno eval 'true'", + "cwd": "tests", + "deno": { + "eval": {} + } + }, + "flags:eval": { + "task": "deno eval 'true'", + "cwd": "tests", + "deno": { + "eval": { + "print": true, + "ext": "ts" + } + } + } + } +} diff --git a/tests/deno_fmt.jsonc b/tests/deno_fmt.jsonc index 402cd26..548eb80 100644 --- a/tests/deno_fmt.jsonc +++ b/tests/deno_fmt.jsonc @@ -5,76 +5,25 @@ "+tasks": { "flags:none": { "task": "deno fmt mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "fmt": {} + } }, - "flags:boolean_true": { + "flags:fmt": { "task": "deno fmt mod.ts", "cwd": "tests", "deno": { "fmt": { "check": true, - "tabs": true, - "semicolons": true - } - } - }, - "flags:boolean_false": { - "task": "deno fmt mod.ts", - "cwd": "tests", - "deno": { - "fmt": { - "check": false, "tabs": false, - "singleQuote": false, - "semicolons": false - } - } - }, - "flags:single_quote": { - "task": "deno fmt mod.ts || true", - "cwd": "tests", - "deno": { - "fmt": { - "check": true, - "singleQuote": true - } - } - }, - "flags:string": { - "task": "deno fmt mod.ts", - "cwd": "tests", - "deno": { - "fmt": { - "proseWrap": "always", - "ext": "js" - } - } - }, - "flags:number": { - "task": "deno fmt mod.ts", - "cwd": "tests", - "deno": { - "fmt": { "lineWidth": 80, - "indentWidth": 2 - } - } - }, - "flags:array": { - "task": "deno fmt mod.ts", - "cwd": "tests", - "deno": { - "fmt": { - "ignore": ["mod_test.ts"] - } - } - }, - "flags:array_empty": { - "task": "deno fmt mod.ts", - "cwd": "tests", - "deno": { - "fmt": { - "ignore": [] + "indentWidth": 2, + "singleQuote": false, + "semicolons": false, + "proseWrap": "always", + "ignore": ["mod_test.ts"], + "ext": "js" } } } diff --git a/tests/deno_info.jsonc b/tests/deno_info.jsonc index 966731d..f38abeb 100644 --- a/tests/deno_info.jsonc +++ b/tests/deno_info.jsonc @@ -5,9 +5,12 @@ "+tasks": { "flags:none": { "task": "deno info", - "cwd": "tests" + "cwd": "tests", + "deno": { + "info": {} + } }, - "flags:boolean_true": { + "flags:info": { "task": "deno info", "cwd": "tests", "deno": { @@ -15,15 +18,6 @@ "json": true } } - }, - "flags:boolean_false": { - "task": "deno info", - "cwd": "tests", - "deno": { - "info": { - "json": false - } - } } } } diff --git a/tests/deno_install.jsonc b/tests/deno_install.jsonc index 0967ef4..6154aba 100644 --- a/tests/deno_install.jsonc +++ b/tests/deno_install.jsonc @@ -1 +1,25 @@ -{} +{ + "tasks": { + "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" + }, + "+tasks": { + "flags:none": { + "task": "deno help", + "cwd": "tests", + "deno": { + "install": {} + } + }, + "flags:install": { + "task": "deno help", + "cwd": "tests", + "deno": { + "install": { + "name": "test_deno_make", + "root": "/tmp", + "force": true + } + } + } + } +} diff --git a/tests/deno_lint.jsonc b/tests/deno_lint.jsonc index 13484d3..c3b5f27 100644 --- a/tests/deno_lint.jsonc +++ b/tests/deno_lint.jsonc @@ -5,51 +5,18 @@ "+tasks": { "flags:none": { "task": "deno lint", - "cwd": "tests" + "cwd": "tests", + "deno": { + "lint": {} + } }, - "flags:json": { + "flags:lint": { "task": "deno lint", "cwd": "tests", "deno": { "lint": { "json": true, - "compact": false - } - } - }, - "flags:compact": { - "task": "deno lint", - "cwd": "tests", - "deno": { - "lint": { - "compact": true, - "json": false - } - } - }, - "flags:array": { - "task": "deno lint", - "cwd": "tests", - "deno": { - "lint": { - "ignore": ["*.js"] - } - } - }, - "flags:array_empty": { - "task": "deno lint", - "cwd": "tests", - "deno": { - "lint": { - "ignore": [] - } - } - }, - "flags:rules": { - "task": "deno lint", - "cwd": "tests", - "deno": { - "lint": { + "ignore": ["*.js"], "rules": { "tags": ["recommended"], "include": ["single-var-declarator"], @@ -58,16 +25,13 @@ } } }, - "flags:rules_empty": { + "flags:lint_alt": { "task": "deno lint", "cwd": "tests", "deno": { "lint": { - "rules": { - "tags": [], - "include": [], - "exclude": [] - } + "compact": true, + "rules": {} } } } diff --git a/tests/deno_make.jsonc b/tests/deno_make.jsonc index e3bccd0..630924f 100644 --- a/tests/deno_make.jsonc +++ b/tests/deno_make.jsonc @@ -3,31 +3,33 @@ "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" }, "+tasks": { - "make": { - "task": "exit 1" + "make:empty": { + "task": "deno help" }, - "make:description": { - "task": "exit 1", - "description": "🦕 test" - }, - "make:deno": { + "make:task": { "task": "deno info", + "cwd": "tests", + "description": "🦕 test", "deno": { "info": { "quiet": true } - } - }, - "make:env": { - "task": "exit 1", + }, "env": { "DINOSAUR": "🦖", "TEST_INHERIT": true } }, - "make:cwd": { - "task": "cwd", - "cwd": "tests" + "make:multiline": { + "task": ["deno help"], + "cwd": "tests", + "description": ["🦕 test"] + }, + "make:exit": { + "task": "exit 1" + }, + "make:rm_deno_make_json": { + "task": "rm -r .deno-make.json" } } } diff --git a/tests/deno_repl.jsonc b/tests/deno_repl.jsonc index 0967ef4..0cf6f23 100644 --- a/tests/deno_repl.jsonc +++ b/tests/deno_repl.jsonc @@ -1 +1,24 @@ -{} +{ + "tasks": { + "make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0" + }, + "+tasks": { + "flags:none": { + "task": "deno help", + "cwd": "tests", + "deno": { + "repl": {} + } + }, + "flags:repl": { + "task": "deno help", + "cwd": "tests", + "deno": { + "repl": { + "eval": "true", + "evalFile": ["mod_test.ts"] + } + } + } + } +} diff --git a/tests/deno_run.jsonc b/tests/deno_run.jsonc index 82bd9a0..c5eeb10 100644 --- a/tests/deno_run.jsonc +++ b/tests/deno_run.jsonc @@ -5,9 +5,12 @@ "+tasks": { "flags:none": { "task": "deno run mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "run": {} + } }, - "flags:string": { + "flags:run": { "task": "deno run mod.ts", "cwd": "tests", "deno": { diff --git a/tests/deno_test.jsonc b/tests/deno_test.jsonc index f545ff5..766d76e 100644 --- a/tests/deno_test.jsonc +++ b/tests/deno_test.jsonc @@ -5,9 +5,12 @@ "+tasks": { "flags:none": { "task": "deno test mod_test.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "test": {} + } }, - "flags:boolean_true": { + "flags:test_1": { "task": "deno test mod_test.ts", "cwd": "tests", "deno": { @@ -17,27 +20,27 @@ "failFast": true, "shuffle": true, "parallel": true, - "run": true, - "allowNone": true + "run": false, + "allowNone": true, + "coverage": ".coverage", + "reporter": "junit", + "filter": "junit", + "junitPath": ".junit.xml", + "ignore": ["*_test.ts"] } } }, - "flags:boolean_false": { + "flags:test_2": { "task": "deno test mod_test.ts", "cwd": "tests", "deno": { "test": { - "doc": false, - "traceOps": false, "failFast": false, - "shuffle": false, - "parallel": false, - "run": false, - "allowNone": false + "shuffle": false } } }, - "flags:number": { + "flags:test_3": { "task": "deno test mod_test.ts", "cwd": "tests", "deno": { @@ -46,36 +49,6 @@ "shuffle": 1 } } - }, - "flags:string": { - "task": "deno test mod_test.ts", - "cwd": "tests", - "deno": { - "test": { - "coverage": ".coverage", - "reporter": "junit", - "filter": "junit", - "junitPath": ".junit.xml" - } - } - }, - "flags:array": { - "task": "deno test mod_test.ts", - "cwd": "tests", - "deno": { - "test": { - "ignore": ["*_test.ts"] - } - } - }, - "flags:array_empty": { - "task": "deno test mod_test.ts", - "cwd": "tests", - "deno": { - "test": { - "ignore": [] - } - } } } } diff --git a/tests/deno_types.jsonc b/tests/deno_types.jsonc index d401fa6..e2c8b3d 100644 --- a/tests/deno_types.jsonc +++ b/tests/deno_types.jsonc @@ -5,7 +5,10 @@ "+tasks": { "flags:none": { "task": "deno types", - "cwd": "tests" + "cwd": "tests", + "deno": { + "types": {} + } }, "flags:common": { "task": "deno types", diff --git a/tests/deno_uninstall.jsonc b/tests/deno_uninstall.jsonc index 3c3e9ec..30ea0d6 100644 --- a/tests/deno_uninstall.jsonc +++ b/tests/deno_uninstall.jsonc @@ -10,7 +10,7 @@ "uninstall": {} } }, - "flags:root": { + "flags:uninstall": { "task": "deno help", "cwd": "tests", "deno": { diff --git a/tests/deno_vendor.jsonc b/tests/deno_vendor.jsonc index 3ea6afb..6676db5 100644 --- a/tests/deno_vendor.jsonc +++ b/tests/deno_vendor.jsonc @@ -5,7 +5,10 @@ "+tasks": { "flags:none": { "task": "deno vendor mod.ts", - "cwd": "tests" + "cwd": "tests", + "deno": { + "vendor": {} + } }, "flags:output_1": { "task": "deno run mod.ts", @@ -23,7 +26,7 @@ "vendor": { "output": { "path": "vendor", - "force:": true + "force": true } } } @@ -34,19 +37,9 @@ "deno": { "vendor": { "output": { - "force:": false } } } - }, - "flags:lock": { - "task": "deno run mod.ts", - "cwd": "tests", - "deno": { - "vendor": { - "lock": "deno.lock" - } - } } } } diff --git a/tests/mod_bench.ts b/tests/mod_bench.ts new file mode 100644 index 0000000..e431bc6 --- /dev/null +++ b/tests/mod_bench.ts @@ -0,0 +1 @@ +Deno.bench("dummy bench", () => void null)