Comparing version 1.9.3 to 1.9.4
@@ -5,2 +5,3 @@ #! /usr/bin/env node | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* c8 ignore start */ | ||
const list_files_js_1 = require("../modules/list-files.js"); | ||
@@ -11,3 +12,2 @@ const get_arg_js_1 = require("../helpers/get-arg.js"); | ||
const format_js_1 = require("../helpers/format.js"); | ||
/* c8 ignore start */ | ||
const dirs = ((0, get_arg_js_1.hasArg)('include') | ||
@@ -24,3 +24,2 @@ ? (_a = (0, get_arg_js_1.getArg)('include')) === null || _a === void 0 ? void 0 : _a.split(',') | ||
console.log(`The flag ${format_js_1.format.bold('--log-success')} is deprecated. Use ${format_js_1.format.bold('--debug')} instead.`); | ||
/* c8 ignore end */ | ||
(0, index_js_1.poku)(dirs, { | ||
@@ -34,1 +33,2 @@ platform: (0, get_runtime_js_1.platformIsValid)(platform) ? platform : undefined, | ||
}); | ||
/* c8 ignore stop */ |
@@ -29,2 +29,2 @@ "use strict"; | ||
exports.findFile = findFile; | ||
/* c8 ignore end */ | ||
/* c8 ignore stop */ |
@@ -18,2 +18,2 @@ "use strict"; | ||
exports.padStart = padStart; | ||
/* c8 ignore end */ | ||
/* c8 ignore stop */ |
@@ -181,8 +181,7 @@ "use strict"; | ||
} | ||
/* c8 ignore start */ | ||
const match = (value, regExp, message) => __awaiter(void 0, void 0, void 0, function* () { | ||
/* c8 ignore start */ | ||
if (typeof get_runtime_js_1.nodeVersion === 'number' && get_runtime_js_1.nodeVersion < 12) { | ||
throw new Error('match is available from Node.js 12 or higher'); | ||
} | ||
/* c8 ignore stop */ | ||
yield (0, parseAsssetion_js_1.parseAssertion)(() => nodeAssert === null || nodeAssert === void 0 ? void 0 : nodeAssert.match(value, regExp), { | ||
@@ -195,8 +194,8 @@ message, | ||
}); | ||
/* c8 ignore stop */ | ||
/* c8 ignore start */ | ||
const doesNotMatch = (value, regExp, message) => __awaiter(void 0, void 0, void 0, function* () { | ||
/* c8 ignore start */ | ||
if (typeof get_runtime_js_1.nodeVersion === 'number' && get_runtime_js_1.nodeVersion < 12) { | ||
throw new Error('doesNotMatch is available from Node.js 12 or higher'); | ||
} | ||
/* c8 ignore stop */ | ||
yield (0, parseAsssetion_js_1.parseAssertion)(() => nodeAssert.doesNotMatch(value, regExp), { | ||
@@ -209,2 +208,3 @@ message, | ||
}); | ||
/* c8 ignore stop */ | ||
exports.assertPromise = Object.assign((value, message) => ok(value, message), { | ||
@@ -211,0 +211,0 @@ ok, |
@@ -171,8 +171,7 @@ "use strict"; | ||
} | ||
/* c8 ignore start */ | ||
const match = (value, regExp, message) => { | ||
/* c8 ignore start */ | ||
if (typeof get_runtime_js_1.nodeVersion === 'number' && get_runtime_js_1.nodeVersion < 12) { | ||
throw new Error('match is available from Node.js 12 or higher'); | ||
} | ||
/* c8 ignore stop */ | ||
(0, parseAsssetion_js_1.parseAssertion)(() => nodeAssert === null || nodeAssert === void 0 ? void 0 : nodeAssert.match(value, regExp), { | ||
@@ -185,8 +184,8 @@ message, | ||
}; | ||
/* c8 ignore stop */ | ||
/* c8 ignore start */ | ||
const doesNotMatch = (value, regExp, message) => { | ||
/* c8 ignore start */ | ||
if (typeof get_runtime_js_1.nodeVersion === 'number' && get_runtime_js_1.nodeVersion < 12) { | ||
throw new Error('doesNotMatch is available from Node.js 12 or higher'); | ||
} | ||
/* c8 ignore stop */ | ||
(0, parseAsssetion_js_1.parseAssertion)(() => nodeAssert.doesNotMatch(value, regExp), { | ||
@@ -199,2 +198,3 @@ message, | ||
}; | ||
/* c8 ignore stop */ | ||
exports.assert = Object.assign((value, message) => ok(value, message), { | ||
@@ -201,0 +201,0 @@ ok, |
@@ -30,3 +30,3 @@ "use strict"; | ||
}); | ||
/* c8 ignore end */ | ||
/* c8 ignore stop */ | ||
const backgroundProcess = (runtime, args, file, options) => new Promise((resolve, reject) => { | ||
@@ -36,6 +36,9 @@ let isResolved = false; | ||
stdio: ['inherit', 'pipe', 'pipe'], | ||
shell: false, | ||
/* c8 ignore next */ | ||
shell: runner_js_1.isWindows, | ||
cwd: (options === null || options === void 0 ? void 0 : options.cwd) ? (0, list_files_js_1.sanitizePath)(node_path_1.default.normalize(options.cwd)) : undefined, | ||
env: node_process_1.default.env, | ||
/* c8 ignore next */ | ||
detached: !runner_js_1.isWindows, | ||
/* c8 ignore next */ | ||
windowsHide: runner_js_1.isWindows, | ||
@@ -61,3 +64,3 @@ timeout: options === null || options === void 0 ? void 0 : options.timeout, | ||
runningProcesses[PID] = end; | ||
/* c8 ignore end */ | ||
/* c8 ignore stop */ | ||
service.stdout.on('data', (data) => { | ||
@@ -148,5 +151,5 @@ if (!isResolved && typeof (options === null || options === void 0 ? void 0 : options.startAfter) !== 'number') { | ||
throw new Error(`${format_js_1.format.bold('startScript')} currently doesn't works for Bun and Deno.${node_os_1.EOL}See: https://github.com/wellwelwel/poku/issues/143`); | ||
/* c8 ignore end */ | ||
/* c8 ignore stop */ | ||
return yield backgroundProcess(runtime, runtimeArgs, script, Object.assign(Object.assign({}, options), { isScript: true, runner })); | ||
}); | ||
exports.startScript = startScript; |
"use strict"; | ||
/* c8 ignore start */ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -34,1 +35,2 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}); | ||
/* c8 ignore stop */ |
@@ -26,2 +26,4 @@ "use strict"; | ||
const each_js_1 = require("./each.js"); | ||
/* c8 ignore stop */ | ||
/* c8 ignore start */ | ||
exports.fileResults = { | ||
@@ -31,2 +33,3 @@ success: [], | ||
}; | ||
/* c8 ignore stop */ | ||
const runTestFile = (filePath, configs) => new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -80,3 +83,4 @@ const runtimeOptions = (0, runner_js_1.runner)(filePath, configs); | ||
stdio: ['inherit', 'pipe', 'pipe'], | ||
shell: false, | ||
/* c8 ignore next */ | ||
shell: runner_js_1.isWindows, | ||
env: Object.assign(Object.assign({}, node_process_1.default.env), { FILE: (configs === null || configs === void 0 ? void 0 : configs.parallel) ? fileRelative : '' }), | ||
@@ -83,0 +87,0 @@ }); |
{ | ||
"name": "poku", | ||
"version": "1.9.3", | ||
"version": "1.9.4", | ||
"description": "๐ท Poku makes testing easy for Node.js, Bun & Deno at the same time.", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"test": "npx poku --parallel --debug test/unit,test/integration,test/e2e", | ||
"pretest:c8": "npm run build", | ||
"test": "tsx src/bin/index.ts --parallel --debug test/unit,test/integration,test/e2e", | ||
"test:c8": "c8 npm run test", | ||
@@ -106,5 +105,5 @@ "test:ci": "tsx ./test/ci.test.ts", | ||
"devDependencies": { | ||
"@types/node": "^20.11.27", | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0", | ||
"@types/node": "^20.12.7", | ||
"@typescript-eslint/eslint-plugin": "^7.7.1", | ||
"@typescript-eslint/parser": "^7.7.1", | ||
"c8": "^9.1.0", | ||
@@ -120,4 +119,4 @@ "eslint": "^8.57.0", | ||
"tsx": "4.2.1", | ||
"typescript": "^5.4.2" | ||
"typescript": "^5.4.5" | ||
} | ||
} |
@@ -114,4 +114,4 @@ [node-version-url]: https://github.com/nodejs/node | ||
```ts | ||
import { poku } from 'npm:poku'; | ||
```bash | ||
deno add npm:poku | ||
``` | ||
@@ -128,3 +128,3 @@ | ||
<td> | ||
<em><code>test/file.test.js</code></em> | ||
<em><code>test/file.test.mjs</code></em> | ||
</td> | ||
@@ -145,3 +145,4 @@ </tr> | ||
> Note that these examples use [**ESM**](https://poku.io/docs/examples/cjs-esm), but you can use [**CJS**](https://poku.io/docs/examples/cjs-esm) as well. | ||
- Change from `.mjs` to `.js` by defining `"type": "module"` in your _package.json_. | ||
- Note that these examples use [**ESM**](https://poku.io/docs/examples/cjs-esm), but you can use [**CJS**](https://poku.io/docs/examples/cjs-esm) as well. | ||
@@ -148,0 +149,0 @@ ### Run it ๐ |
105262
2016
294