1tube 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/test/api.d.ts +2 -1
- package/dist/test/node.js +4 -4
- package/package.json +1 -1
- package/src/cli/deno-config.ts +2 -2
- package/src/test/api.ts +2 -1
- package/src/test/bun.ts +4 -4
- package/src/test/node.ts +4 -4
package/dist/test/api.d.ts
CHANGED
|
@@ -44,7 +44,8 @@ export interface DescribeFunction extends RegisterSuite {
|
|
|
44
44
|
skipIf(condition: unknown): RegisterSuite;
|
|
45
45
|
each<Row>(table: readonly Row[]): (name: string, fn: (...args: EachArgs<Row>) => void) => void;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
/** A setup/teardown hook; `timeout` in milliseconds (runner default when omitted). */
|
|
48
|
+
export type Hook = (fn: HookFn, timeout?: number) => void;
|
|
48
49
|
type AnyFn = (...args: any[]) => any;
|
|
49
50
|
export interface MockFunction {
|
|
50
51
|
/** A mock function (records calls; optional implementation). */
|
package/dist/test/node.js
CHANGED
|
@@ -17,10 +17,10 @@ export const { test, it, describe, beforeAll, afterAll, beforeEach, afterEach, m
|
|
|
17
17
|
test: (name, fn, { timeout, skip, only }) => void node.test(name, { timeout, skip, only }, wrap(fn)),
|
|
18
18
|
todo: (name) => void node.test(name, { todo: true }),
|
|
19
19
|
describe: (name, fn, mode) => void node.describe(name, { skip: mode === "skip", only: mode === "only" }, fn),
|
|
20
|
-
beforeAll: (fn) => node.before(wrap(fn)),
|
|
21
|
-
afterAll: (fn) => node.after(wrap(fn)),
|
|
22
|
-
beforeEach: (fn) => node.beforeEach(wrap(fn)),
|
|
23
|
-
afterEach: (fn) => node.afterEach(wrap(fn)),
|
|
20
|
+
beforeAll: (fn, timeout) => node.before(wrap(fn), { timeout }),
|
|
21
|
+
afterAll: (fn, timeout) => node.after(wrap(fn), { timeout }),
|
|
22
|
+
beforeEach: (fn, timeout) => node.beforeEach(wrap(fn), { timeout }),
|
|
23
|
+
afterEach: (fn, timeout) => node.afterEach(wrap(fn), { timeout }),
|
|
24
24
|
mockModule: (specifier, factory) => {
|
|
25
25
|
const moduleMock = node.mock.module;
|
|
26
26
|
if (typeof moduleMock !== "function") {
|
package/package.json
CHANGED
package/src/cli/deno-config.ts
CHANGED
|
@@ -67,8 +67,8 @@ export async function resolveDenoConfigPath(
|
|
|
67
67
|
return { configPath: found };
|
|
68
68
|
}
|
|
69
69
|
onMessage?.(
|
|
70
|
-
`no
|
|
71
|
-
`
|
|
70
|
+
`no import map at ${cwd} or ${fnDirAbs}; bare imports resolve from ` +
|
|
71
|
+
`node_modules (package.json is the version source).`,
|
|
72
72
|
);
|
|
73
73
|
return {};
|
|
74
74
|
}
|
package/src/test/api.ts
CHANGED
|
@@ -55,7 +55,8 @@ export interface DescribeFunction extends RegisterSuite {
|
|
|
55
55
|
each<Row>(table: readonly Row[]): (name: string, fn: (...args: EachArgs<Row>) => void) => void;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
/** A setup/teardown hook; `timeout` in milliseconds (runner default when omitted). */
|
|
59
|
+
export type Hook = (fn: HookFn, timeout?: number) => void;
|
|
59
60
|
|
|
60
61
|
// `any` is unavoidable for generic function shapes.
|
|
61
62
|
type AnyFn = (...args: any[]) => any;
|
package/src/test/bun.ts
CHANGED
|
@@ -24,10 +24,10 @@ export const { test, it, describe, beforeAll, afterAll, beforeEach, afterEach, m
|
|
|
24
24
|
todo: (name) => bun.test.todo(name, () => {}),
|
|
25
25
|
describe: (name, fn, mode) =>
|
|
26
26
|
mode === "skip" ? bun.describe.skip(name, fn) : mode === "only" ? bun.describe.only(name, fn) : bun.describe(name, fn),
|
|
27
|
-
beforeAll: (fn) => bun.beforeAll(fn),
|
|
28
|
-
afterAll: (fn) => bun.afterAll(fn),
|
|
29
|
-
beforeEach: (fn) => bun.beforeEach(fn),
|
|
30
|
-
afterEach: (fn) => bun.afterEach(fn),
|
|
27
|
+
beforeAll: (fn, timeout) => bun.beforeAll(fn, timeout),
|
|
28
|
+
afterAll: (fn, timeout) => bun.afterAll(fn, timeout),
|
|
29
|
+
beforeEach: (fn, timeout) => bun.beforeEach(fn, timeout),
|
|
30
|
+
afterEach: (fn, timeout) => bun.afterEach(fn, timeout),
|
|
31
31
|
mockModule: (specifier, factory) => {
|
|
32
32
|
void bun.mock.module(specifier.startsWith("file:") ? fileURLToPath(specifier) : specifier, factory);
|
|
33
33
|
},
|
package/src/test/node.ts
CHANGED
|
@@ -25,10 +25,10 @@ export const { test, it, describe, beforeAll, afterAll, beforeEach, afterEach, m
|
|
|
25
25
|
test: (name, fn, { timeout, skip, only }) => void node.test(name, { timeout, skip, only }, wrap(fn)),
|
|
26
26
|
todo: (name) => void node.test(name, { todo: true }),
|
|
27
27
|
describe: (name, fn, mode) => void node.describe(name, { skip: mode === "skip", only: mode === "only" }, fn),
|
|
28
|
-
beforeAll: (fn) => node.before(wrap(fn)),
|
|
29
|
-
afterAll: (fn) => node.after(wrap(fn)),
|
|
30
|
-
beforeEach: (fn) => node.beforeEach(wrap(fn)),
|
|
31
|
-
afterEach: (fn) => node.afterEach(wrap(fn)),
|
|
28
|
+
beforeAll: (fn, timeout) => node.before(wrap(fn), { timeout }),
|
|
29
|
+
afterAll: (fn, timeout) => node.after(wrap(fn), { timeout }),
|
|
30
|
+
beforeEach: (fn, timeout) => node.beforeEach(wrap(fn), { timeout }),
|
|
31
|
+
afterEach: (fn, timeout) => node.afterEach(wrap(fn), { timeout }),
|
|
32
32
|
mockModule: (specifier, factory) => {
|
|
33
33
|
const moduleMock = (node.mock as { module?: (s: string, o: object) => unknown }).module;
|
|
34
34
|
if (typeof moduleMock !== "function") {
|