Comparing version 2.6.3-canary.d4b7b64 to 2.6.3-canary.eed39f5
@@ -26,2 +26,3 @@ "use strict"; | ||
'--node', | ||
'--only', | ||
'--parallel', | ||
@@ -28,0 +29,0 @@ '--platform', |
@@ -21,2 +21,7 @@ #! /usr/bin/env node | ||
} | ||
if ((0, get_arg_js_1.hasArg)('help') || (0, get_arg_js_1.hasArg)('h', '-')) { | ||
const { help } = require('./help.js'); | ||
help(); | ||
return; | ||
} | ||
const enforce = (0, get_arg_js_1.hasArg)('enforce') || (0, get_arg_js_1.hasArg)('x', '-'); | ||
@@ -23,0 +28,0 @@ const configFile = (0, get_arg_js_1.getArg)('config') || (0, get_arg_js_1.getArg)('c', '-'); |
@@ -8,1 +8,2 @@ export declare const results: { | ||
export declare const VERSION = ""; | ||
export declare const deepOptions: string[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = exports.results = void 0; | ||
exports.deepOptions = exports.VERSION = exports.results = void 0; | ||
exports.results = { | ||
@@ -10,2 +10,3 @@ success: 0, | ||
}; | ||
exports.VERSION = '2.6.3-canary.d4b7b64'; | ||
exports.VERSION = '2.6.3-canary.eed39f5'; | ||
exports.deepOptions = []; |
import type { DescribeOptions } from '../../@types/describe.js'; | ||
import { todo, skip } from './modifiers.js'; | ||
declare function describeCore(title: string, cb: () => Promise<unknown>): Promise<void>; | ||
declare function describeCore(title: string, cb: () => unknown): void; | ||
import { todo, skip, onlyDescribe } from './modifiers.js'; | ||
export declare function describeBase(arg1: string | (() => unknown | Promise<unknown>), arg2?: (() => unknown | Promise<unknown>) | DescribeOptions): Promise<void>; | ||
declare function describeCore(message: string, cb: () => Promise<unknown>): Promise<void>; | ||
declare function describeCore(message: string, cb: () => unknown): void; | ||
declare function describeCore(cb: () => Promise<unknown>): Promise<void>; | ||
declare function describeCore(cb: () => unknown): unknown; | ||
declare function describeCore(title: string, options?: DescribeOptions): void; | ||
declare function describeCore(cb: () => unknown): void; | ||
declare function describeCore(message: string, options?: DescribeOptions): void; | ||
export declare const describe: typeof describeCore & { | ||
todo: typeof todo; | ||
skip: typeof skip; | ||
only: typeof onlyDescribe; | ||
}; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.describe = void 0; | ||
exports.describeBase = describeBase; | ||
const node_process_1 = require("process"); | ||
@@ -9,3 +10,4 @@ const format_js_1 = require("../../services/format.js"); | ||
const modifiers_js_1 = require("./modifiers.js"); | ||
async function describeCore(arg1, arg2) { | ||
const get_arg_js_1 = require("../../parsers/get-arg.js"); | ||
async function describeBase(arg1, arg2) { | ||
let title; | ||
@@ -50,5 +52,16 @@ let cb; | ||
} | ||
async function describeCore(messageOrCb, cbOrOptions) { | ||
if (typeof messageOrCb === 'string' && typeof cbOrOptions !== 'function') | ||
return describeBase(messageOrCb, cbOrOptions); | ||
if (get_arg_js_1.hasOnly || get_arg_js_1.hasDescribeOnly) | ||
return; | ||
if (typeof messageOrCb === 'string' && typeof cbOrOptions === 'function') | ||
return describeBase(messageOrCb, cbOrOptions); | ||
if (typeof messageOrCb === 'function') | ||
return describeBase(messageOrCb); | ||
} | ||
exports.describe = Object.assign(describeCore, { | ||
todo: modifiers_js_1.todo, | ||
skip: modifiers_js_1.skip, | ||
only: modifiers_js_1.onlyDescribe, | ||
}); |
@@ -1,2 +0,6 @@ | ||
import { todo, skip } from '../modifiers.js'; | ||
import { todo, skip, onlyIt } from '../modifiers.js'; | ||
export declare function itBase(...args: [ | ||
string | (() => unknown | Promise<unknown>), | ||
(() => unknown | Promise<unknown>)? | ||
]): Promise<void>; | ||
declare function itCore(message: string, cb: () => Promise<unknown>): Promise<void>; | ||
@@ -9,3 +13,4 @@ declare function itCore(message: string, cb: () => unknown): void; | ||
skip: typeof skip; | ||
only: typeof onlyIt; | ||
}; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.it = void 0; | ||
exports.itBase = itBase; | ||
const node_process_1 = require("process"); | ||
@@ -10,3 +11,4 @@ const each_js_1 = require("../../../configs/each.js"); | ||
const modifiers_js_1 = require("../modifiers.js"); | ||
async function itCore(...args) { | ||
const get_arg_js_1 = require("../../../parsers/get-arg.js"); | ||
async function itBase(...args) { | ||
try { | ||
@@ -60,5 +62,14 @@ let message; | ||
} | ||
async function itCore(messageOrCb, cb) { | ||
if (get_arg_js_1.hasOnly || get_arg_js_1.hasItOnly) | ||
return; | ||
if (typeof messageOrCb === 'string' && cb) | ||
return itBase(messageOrCb, cb); | ||
if (typeof messageOrCb === 'function') | ||
return itBase(messageOrCb); | ||
} | ||
exports.it = Object.assign(itCore, { | ||
todo: modifiers_js_1.todo, | ||
skip: modifiers_js_1.skip, | ||
only: modifiers_js_1.onlyIt, | ||
}); |
@@ -8,1 +8,9 @@ export declare function todo(message: string): void; | ||
export declare function skip(cb: () => unknown): void; | ||
export declare function onlyDescribe(message: string, cb: () => Promise<unknown>): Promise<void>; | ||
export declare function onlyDescribe(message: string, cb: () => unknown): void; | ||
export declare function onlyDescribe(cb: () => Promise<unknown>): Promise<void>; | ||
export declare function onlyDescribe(cb: () => unknown): void; | ||
export declare function onlyIt(message: string, cb: () => Promise<unknown>): Promise<void>; | ||
export declare function onlyIt(message: string, cb: () => unknown): void; | ||
export declare function onlyIt(cb: () => Promise<unknown>): Promise<void>; | ||
export declare function onlyIt(cb: () => unknown): void; |
@@ -5,5 +5,11 @@ "use strict"; | ||
exports.skip = skip; | ||
exports.onlyDescribe = onlyDescribe; | ||
exports.onlyIt = onlyIt; | ||
const write_js_1 = require("../../services/write.js"); | ||
const indentation_js_1 = require("../../configs/indentation.js"); | ||
const format_js_1 = require("../../services/format.js"); | ||
const core_js_1 = require("./it/core.js"); | ||
const describe_js_1 = require("./describe.js"); | ||
const get_arg_js_1 = require("../../parsers/get-arg.js"); | ||
const node_process_1 = require("process"); | ||
async function todo(message, _cb) { | ||
@@ -16,1 +22,21 @@ write_js_1.Write.log(`${indentation_js_1.indentation.hasDescribe ? ' ' : ''}${(0, format_js_1.format)(`● ${message}`).cyan().bold()}`); | ||
} | ||
async function onlyDescribe(messageOrCb, cb) { | ||
if (!(get_arg_js_1.hasOnly || get_arg_js_1.hasDescribeOnly)) { | ||
write_js_1.Write.log((0, format_js_1.format)("Can't run `describe.only` tests without `--only` or `--only=describe` flags").fail()); | ||
(0, node_process_1.exit)(1); | ||
} | ||
if (typeof messageOrCb === 'string' && cb) | ||
return (0, describe_js_1.describeBase)(messageOrCb, cb); | ||
if (typeof messageOrCb === 'function') | ||
return (0, describe_js_1.describeBase)(messageOrCb); | ||
} | ||
async function onlyIt(messageOrCb, cb) { | ||
if (!(get_arg_js_1.hasOnly || get_arg_js_1.hasItOnly)) { | ||
write_js_1.Write.log((0, format_js_1.format)("Can't run `it.only` and `test.only` tests without `--only`, `--only=it` or `--only=test` flags").fail()); | ||
(0, node_process_1.exit)(1); | ||
} | ||
if (typeof messageOrCb === 'string' && cb) | ||
return (0, core_js_1.itBase)(messageOrCb, cb); | ||
if (typeof messageOrCb === 'function') | ||
return (0, core_js_1.itBase)(messageOrCb); | ||
} |
@@ -9,2 +9,3 @@ export declare const test: { | ||
skip: typeof import("./modifiers.js").skip; | ||
only: typeof import("./modifiers.js").onlyIt; | ||
}; |
@@ -5,1 +5,4 @@ export declare const getArg: (arg: string, prefix?: string, baseArgs?: string[]) => string | undefined; | ||
export declare const argToArray: (arg: string, prefix?: string, baseArgs?: string[]) => string[] | undefined; | ||
export declare const hasOnly: boolean; | ||
export declare const hasDescribeOnly: boolean; | ||
export declare const hasItOnly: boolean | "" | undefined; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.argToArray = exports.getPaths = exports.hasArg = exports.getArg = void 0; | ||
exports.hasItOnly = exports.hasDescribeOnly = exports.hasOnly = exports.argToArray = exports.getPaths = exports.hasArg = exports.getArg = void 0; | ||
const node_process_1 = require("process"); | ||
@@ -46,1 +46,5 @@ const to_dynamic_case_js_1 = require("./to-dynamic-case.js"); | ||
exports.argToArray = argToArray; | ||
const only = (0, exports.getArg)('only'); | ||
exports.hasOnly = (0, exports.hasArg)('only') && !only; | ||
exports.hasDescribeOnly = only === 'describe'; | ||
exports.hasItOnly = only && ['it', 'test'].includes(only); |
@@ -14,2 +14,3 @@ "use strict"; | ||
const write_js_1 = require("./write.js"); | ||
const poku_js_1 = require("../configs/poku.js"); | ||
const cwd = (0, node_process_1.cwd)(); | ||
@@ -26,3 +27,3 @@ const runTestFile = async (filePath, configs) => { | ||
configs.deno.cjs.some((ext) => filePath.includes(ext))) | ||
? 'https://cdn.jsdelivr.net/npm/poku/lib/polyfills/deno.mjs' | ||
? `https://cdn.jsdelivr.net/npm/poku${poku_js_1.VERSION ? `@${poku_js_1.VERSION}` : ''}/lib/polyfills/deno.mjs` | ||
: filePath, | ||
@@ -46,3 +47,3 @@ ]; | ||
var _a; | ||
const child = (0, node_child_process_1.spawn)(runtime, runtimeArguments, { | ||
const child = (0, node_child_process_1.spawn)(runtime, [...runtimeArguments, ...poku_js_1.deepOptions], { | ||
stdio: ['inherit', 'pipe', 'pipe'], | ||
@@ -49,0 +50,0 @@ shell: get_runner_js_1.isWindows, |
@@ -18,3 +18,10 @@ "use strict"; | ||
const os_js_1 = require("../polyfills/os.js"); | ||
const get_arg_js_1 = require("../parsers/get-arg.js"); | ||
const cwd = node_process_1.default.cwd(); | ||
if (get_arg_js_1.hasDescribeOnly) | ||
poku_js_1.deepOptions.push('--only=describe'); | ||
else if (get_arg_js_1.hasItOnly) | ||
poku_js_1.deepOptions.push('--only=it'); | ||
else if (get_arg_js_1.hasOnly) | ||
poku_js_1.deepOptions.push('--only'); | ||
const runTests = async (dir, configs) => { | ||
@@ -21,0 +28,0 @@ const testDir = (0, node_path_1.join)(cwd, dir); |
{ | ||
"name": "poku", | ||
"version": "2.6.3-canary.d4b7b64", | ||
"version": "2.6.3-canary.eed39f5", | ||
"description": "🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.", | ||
@@ -54,3 +54,3 @@ "main": "./lib/modules/index.js", | ||
"lint:fix": "npx @biomejs/biome lint --write && prettier --write .github/workflows/*.yml .", | ||
"update": "pu minor && npm i && npm audit fix", | ||
"update": "pu minor && npm i && (npm audit fix || true)", | ||
"postupdate": "npm run lint:fix", | ||
@@ -60,10 +60,10 @@ "benchmark": "cd benchmark && npm ci && npm start" | ||
"devDependencies": { | ||
"@biomejs/biome": "1.8.3", | ||
"@types/node": "^22.5.4", | ||
"@biomejs/biome": "1.9.1", | ||
"@types/node": "^22.5.5", | ||
"c8": "^10.1.2", | ||
"jsonc.min": "^1.1.0", | ||
"monocart-coverage-reports": "^2.10.3", | ||
"monocart-coverage-reports": "^2.10.8", | ||
"packages-update": "^2.0.0", | ||
"prettier": "^3.3.3", | ||
"tsx": "4.19.0", | ||
"tsx": "4.19.1", | ||
"typescript": "^5.6.2" | ||
@@ -70,0 +70,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172338
116
3573