@bemedev/dev-utils 0.6.4 → 0.6.5
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/lib/build-tests/import.cjs +2 -2
- package/lib/build-tests/import.cjs.map +1 -1
- package/lib/build-tests/import.d.ts +5 -2
- package/lib/build-tests/import.js +2 -2
- package/lib/build-tests/import.js.map +1 -1
- package/lib/build-tests/imports/create.cjs +41 -0
- package/lib/build-tests/imports/create.cjs.map +1 -0
- package/lib/build-tests/imports/create.d.ts +7 -0
- package/lib/build-tests/imports/create.js +39 -0
- package/lib/build-tests/imports/create.js.map +1 -0
- package/lib/build-tests/imports/helper.cjs +17 -0
- package/lib/build-tests/imports/helper.cjs.map +1 -0
- package/lib/build-tests/imports/helper.d.ts +9 -0
- package/lib/build-tests/imports/helper.js +15 -0
- package/lib/build-tests/imports/helper.js.map +1 -0
- package/lib/build-tests/imports/index.cjs +3 -0
- package/lib/build-tests/imports/index.d.ts +1 -0
- package/lib/build-tests/imports/index.js +2 -0
- package/lib/build-tests/index.cjs +3 -0
- package/lib/build-tests/index.d.ts +1 -1
- package/lib/build-tests/index.js +3 -1
- package/lib/vitest-extended/acceptation.cjs +2 -2
- package/lib/vitest-extended/acceptation.cjs.map +1 -1
- package/lib/vitest-extended/acceptation.js +2 -2
- package/lib/vitest-extended/acceptation.js.map +1 -1
- package/package.json +7 -9
- package/lib/build-tests/types.d.ts +0 -1
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_utils_identity = require("../utils/identity.cjs");
|
|
3
3
|
const require_build_tests_constants = require("./constants.cjs");
|
|
4
4
|
//#region src/build-tests/import.ts
|
|
5
|
-
const customImport = async (fn = require_utils_identity.identity) => {
|
|
6
|
-
return fn(await import(require_build_tests_constants.THIS1));
|
|
5
|
+
const customImport = async ({ path = "", fn = require_utils_identity.identity }) => {
|
|
6
|
+
return fn(await (path === "" ? import(require_build_tests_constants.THIS1) : import(`${require_build_tests_constants.THIS1}/${path}`)));
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
9
|
exports.customImport = customImport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.cjs","names":["identity","THIS1"],"sources":["../../src/build-tests/import.ts"],"sourcesContent":["import { identity } from '#utils';\nimport { THIS1 } from './constants';\
|
|
1
|
+
{"version":3,"file":"import.cjs","names":["identity","THIS1"],"sources":["../../src/build-tests/import.ts"],"sourcesContent":["import { identity } from '#utils';\nimport { THIS1 } from './constants';\n\ntype Args<T = any> = {\n path?: string;\n fn: (out: any) => T;\n};\n\ntype CustomImport_F = <T = any>(args: Args<T>) => Promise<T>;\n\nexport const customImport: CustomImport_F = async ({\n path = '',\n fn = identity,\n}: Args) => {\n const _path = path === '' ? THIS1 : `${THIS1}/${path}`;\n const out = await import(_path);\n const out2 = fn(out);\n return out2;\n};\n"],"mappings":";;;;AAUA,MAAa,eAA+B,OAAO,EACjD,OAAO,IACP,KAAKA,uBAAAA,eACK;AAIV,QADa,GAAG,OAFF,SAAS,KAAA,OAAKC,8BAAAA,SAAAA,OAAQ,GAAGA,8BAAAA,MAAM,GAAG,SAGrC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type Args<T = any> = {
|
|
2
|
+
path?: string;
|
|
3
|
+
fn: (out: any) => T;
|
|
4
|
+
};
|
|
5
|
+
type CustomImport_F = <T = any>(args: Args<T>) => Promise<T>;
|
|
3
6
|
export declare const customImport: CustomImport_F;
|
|
4
7
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { identity } from "../utils/identity.js";
|
|
2
2
|
import { THIS1 } from "./constants.js";
|
|
3
3
|
//#region src/build-tests/import.ts
|
|
4
|
-
const customImport = async (fn = identity) => {
|
|
5
|
-
return fn(await import(THIS1));
|
|
4
|
+
const customImport = async ({ path = "", fn = identity }) => {
|
|
5
|
+
return fn(await (path === "" ? import(THIS1) : import(`${THIS1}/${path}`)));
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
8
8
|
export { customImport };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","names":[],"sources":["../../src/build-tests/import.ts"],"sourcesContent":["import { identity } from '#utils';\nimport { THIS1 } from './constants';\
|
|
1
|
+
{"version":3,"file":"import.js","names":[],"sources":["../../src/build-tests/import.ts"],"sourcesContent":["import { identity } from '#utils';\nimport { THIS1 } from './constants';\n\ntype Args<T = any> = {\n path?: string;\n fn: (out: any) => T;\n};\n\ntype CustomImport_F = <T = any>(args: Args<T>) => Promise<T>;\n\nexport const customImport: CustomImport_F = async ({\n path = '',\n fn = identity,\n}: Args) => {\n const _path = path === '' ? THIS1 : `${THIS1}/${path}`;\n const out = await import(_path);\n const out2 = fn(out);\n return out2;\n};\n"],"mappings":";;;AAUA,MAAa,eAA+B,OAAO,EACjD,OAAO,IACP,KAAK,eACK;AAIV,QADa,GAAG,OAFF,SAAS,KAAA,OAAK,SAAA,OAAQ,GAAG,MAAM,GAAG,SAGrC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_vitest_extended_toStringFlat = require("../../vitest-extended/toStringFlat.cjs");
|
|
4
|
+
const require_build_tests_imports_helper = require("./helper.cjs");
|
|
5
|
+
let vitest = require("vitest");
|
|
6
|
+
//#region src/build-tests/imports/create.ts
|
|
7
|
+
const createImportFnTests = (args) => {
|
|
8
|
+
const path = args.path;
|
|
9
|
+
const invite = `Importing from ${path ?? "index"}`;
|
|
10
|
+
const testFn = (fn) => require_build_tests_imports_helper.helperFn({
|
|
11
|
+
path,
|
|
12
|
+
fn
|
|
13
|
+
});
|
|
14
|
+
const fn = () => {
|
|
15
|
+
(0, vitest.describe)("#01 => Functions are inside the module", () => {
|
|
16
|
+
const _index = (index) => {
|
|
17
|
+
return require_vitest_extended_toStringFlat.toStringFlat(index + 1, args.SUCCESS.length);
|
|
18
|
+
};
|
|
19
|
+
args.SUCCESS.forEach((fn, index) => {
|
|
20
|
+
(0, vitest.test)(`#${_index(index)} => should succeed with function ${fn}`, () => {
|
|
21
|
+
return testFn(fn);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
(0, vitest.describe)("#02 => Functions are not inside the module", () => {
|
|
26
|
+
const _index = (index) => {
|
|
27
|
+
return require_vitest_extended_toStringFlat.toStringFlat(index + 1, args.FAILS.length);
|
|
28
|
+
};
|
|
29
|
+
args.FAILS.forEach((fn, index) => {
|
|
30
|
+
vitest.test.fails(`#${_index(index)} => should fail with function ${fn}`, () => {
|
|
31
|
+
return testFn(fn);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
return [invite, fn];
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.createImportFnTests = createImportFnTests;
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=create.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.cjs","names":["helperFn","toStringFlat"],"sources":["../../../src/build-tests/imports/create.ts"],"sourcesContent":["import { describe, test } from 'vitest';\nimport { helperFn } from './helper';\nimport { toStringFlat } from '../../vitest-extended/toStringFlat';\n\nexport type ImportArgs = {\n path?: string;\n FAILS: string[];\n SUCCESS: string[];\n};\n\nexport type CreateImportTest_F = (\n args: ImportArgs,\n) => readonly [string, () => void];\n\nexport const createImportFnTests: CreateImportTest_F = args => {\n const path = args.path;\n const invite = `Importing from ${path ?? 'index'}`;\n const testFn = (fn: string) => helperFn({ path, fn });\n\n const fn = () => {\n describe('#01 => Functions are inside the module', () => {\n const _index = (index: number) => {\n return toStringFlat(index + 1, args.SUCCESS.length);\n };\n\n args.SUCCESS.forEach((fn, index) => {\n test(`#${_index(index)} => should succeed with function ${fn}`, () => {\n return testFn(fn);\n });\n });\n });\n\n describe('#02 => Functions are not inside the module', () => {\n const _index = (index: number) => {\n return toStringFlat(index + 1, args.FAILS.length);\n };\n\n args.FAILS.forEach((fn, index) => {\n test.fails(`#${_index(index)} => should fail with function ${fn}`, () => {\n return testFn(fn);\n });\n });\n });\n };\n\n return [invite, fn] as const;\n};\n"],"mappings":";;;;;;AAcA,MAAa,uBAA0C,SAAQ;CAC7D,MAAM,OAAO,KAAK;CAClB,MAAM,SAAS,kBAAkB,QAAQ;CACzC,MAAM,UAAU,OAAeA,mCAAAA,SAAS;EAAE;EAAM;EAAI,CAAC;CAErD,MAAM,WAAW;AACf,GAAA,GAAA,OAAA,UAAS,gDAAgD;GACvD,MAAM,UAAU,UAAkB;AAChC,WAAOC,qCAAAA,aAAa,QAAQ,GAAG,KAAK,QAAQ,OAAO;;AAGrD,QAAK,QAAQ,SAAS,IAAI,UAAU;AAClC,KAAA,GAAA,OAAA,MAAK,IAAI,OAAO,MAAM,CAAC,mCAAmC,YAAY;AACpE,YAAO,OAAO,GAAG;MACjB;KACF;IACF;AAEF,GAAA,GAAA,OAAA,UAAS,oDAAoD;GAC3D,MAAM,UAAU,UAAkB;AAChC,WAAOA,qCAAAA,aAAa,QAAQ,GAAG,KAAK,MAAM,OAAO;;AAGnD,QAAK,MAAM,SAAS,IAAI,UAAU;AAChC,WAAA,KAAK,MAAM,IAAI,OAAO,MAAM,CAAC,gCAAgC,YAAY;AACvE,YAAO,OAAO,GAAG;MACjB;KACF;IACF;;AAGJ,QAAO,CAAC,QAAQ,GAAG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { toStringFlat } from "../../vitest-extended/toStringFlat.js";
|
|
2
|
+
import { helperFn } from "./helper.js";
|
|
3
|
+
import { describe, test } from "vitest";
|
|
4
|
+
//#region src/build-tests/imports/create.ts
|
|
5
|
+
const createImportFnTests = (args) => {
|
|
6
|
+
const path = args.path;
|
|
7
|
+
const invite = `Importing from ${path ?? "index"}`;
|
|
8
|
+
const testFn = (fn) => helperFn({
|
|
9
|
+
path,
|
|
10
|
+
fn
|
|
11
|
+
});
|
|
12
|
+
const fn = () => {
|
|
13
|
+
describe("#01 => Functions are inside the module", () => {
|
|
14
|
+
const _index = (index) => {
|
|
15
|
+
return toStringFlat(index + 1, args.SUCCESS.length);
|
|
16
|
+
};
|
|
17
|
+
args.SUCCESS.forEach((fn, index) => {
|
|
18
|
+
test(`#${_index(index)} => should succeed with function ${fn}`, () => {
|
|
19
|
+
return testFn(fn);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe("#02 => Functions are not inside the module", () => {
|
|
24
|
+
const _index = (index) => {
|
|
25
|
+
return toStringFlat(index + 1, args.FAILS.length);
|
|
26
|
+
};
|
|
27
|
+
args.FAILS.forEach((fn, index) => {
|
|
28
|
+
test.fails(`#${_index(index)} => should fail with function ${fn}`, () => {
|
|
29
|
+
return testFn(fn);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
return [invite, fn];
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { createImportFnTests };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","names":[],"sources":["../../../src/build-tests/imports/create.ts"],"sourcesContent":["import { describe, test } from 'vitest';\nimport { helperFn } from './helper';\nimport { toStringFlat } from '../../vitest-extended/toStringFlat';\n\nexport type ImportArgs = {\n path?: string;\n FAILS: string[];\n SUCCESS: string[];\n};\n\nexport type CreateImportTest_F = (\n args: ImportArgs,\n) => readonly [string, () => void];\n\nexport const createImportFnTests: CreateImportTest_F = args => {\n const path = args.path;\n const invite = `Importing from ${path ?? 'index'}`;\n const testFn = (fn: string) => helperFn({ path, fn });\n\n const fn = () => {\n describe('#01 => Functions are inside the module', () => {\n const _index = (index: number) => {\n return toStringFlat(index + 1, args.SUCCESS.length);\n };\n\n args.SUCCESS.forEach((fn, index) => {\n test(`#${_index(index)} => should succeed with function ${fn}`, () => {\n return testFn(fn);\n });\n });\n });\n\n describe('#02 => Functions are not inside the module', () => {\n const _index = (index: number) => {\n return toStringFlat(index + 1, args.FAILS.length);\n };\n\n args.FAILS.forEach((fn, index) => {\n test.fails(`#${_index(index)} => should fail with function ${fn}`, () => {\n return testFn(fn);\n });\n });\n });\n };\n\n return [invite, fn] as const;\n};\n"],"mappings":";;;;AAcA,MAAa,uBAA0C,SAAQ;CAC7D,MAAM,OAAO,KAAK;CAClB,MAAM,SAAS,kBAAkB,QAAQ;CACzC,MAAM,UAAU,OAAe,SAAS;EAAE;EAAM;EAAI,CAAC;CAErD,MAAM,WAAW;AACf,WAAS,gDAAgD;GACvD,MAAM,UAAU,UAAkB;AAChC,WAAO,aAAa,QAAQ,GAAG,KAAK,QAAQ,OAAO;;AAGrD,QAAK,QAAQ,SAAS,IAAI,UAAU;AAClC,SAAK,IAAI,OAAO,MAAM,CAAC,mCAAmC,YAAY;AACpE,YAAO,OAAO,GAAG;MACjB;KACF;IACF;AAEF,WAAS,oDAAoD;GAC3D,MAAM,UAAU,UAAkB;AAChC,WAAO,aAAa,QAAQ,GAAG,KAAK,MAAM,OAAO;;AAGnD,QAAK,MAAM,SAAS,IAAI,UAAU;AAChC,SAAK,MAAM,IAAI,OAAO,MAAM,CAAC,gCAAgC,YAAY;AACvE,YAAO,OAAO,GAAG;MACjB;KACF;IACF;;AAGJ,QAAO,CAAC,QAAQ,GAAG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_build_tests_import = require("../import.cjs");
|
|
4
|
+
let vitest = require("vitest");
|
|
5
|
+
//#region src/build-tests/imports/helper.ts
|
|
6
|
+
const helperFn = async ({ path, fn }) => {
|
|
7
|
+
const _fn = await require_build_tests_import.customImport({
|
|
8
|
+
path,
|
|
9
|
+
fn: (m) => m[fn]
|
|
10
|
+
});
|
|
11
|
+
(0, vitest.expect)(_fn).toBeDefined();
|
|
12
|
+
(0, vitest.expect)(_fn).toBeTypeOf("function");
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.helperFn = helperFn;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=helper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.cjs","names":["customImport"],"sources":["../../../src/build-tests/imports/helper.ts"],"sourcesContent":["import { expect } from 'vitest';\nimport type { Fn } from '../../vitest-extended/bemedev/globals/types';\nimport { customImport } from '../import';\n\nexport type Helper_F = (args: {\n path?: string;\n fn: string;\n}) => Promise<void>;\n\nexport const helperFn = async <T extends Fn = Fn>({\n path,\n fn,\n}: {\n path?: string;\n fn: string;\n}) => {\n const _fn = await customImport<T>({ path, fn: m => m[fn] });\n expect(_fn).toBeDefined();\n expect(_fn).toBeTypeOf('function');\n};\n"],"mappings":";;;;;AASA,MAAa,WAAW,OAA0B,EAChD,MACA,SAII;CACJ,MAAM,MAAM,MAAMA,2BAAAA,aAAgB;EAAE;EAAM,KAAI,MAAK,EAAE;EAAK,CAAC;AAC3D,EAAA,GAAA,OAAA,QAAO,IAAI,CAAC,aAAa;AACzB,EAAA,GAAA,OAAA,QAAO,IAAI,CAAC,WAAW,WAAW"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Fn } from '../../vitest-extended/bemedev/globals/types';
|
|
2
|
+
export type Helper_F = (args: {
|
|
3
|
+
path?: string;
|
|
4
|
+
fn: string;
|
|
5
|
+
}) => Promise<void>;
|
|
6
|
+
export declare const helperFn: <T extends Fn = Fn>({ path, fn, }: {
|
|
7
|
+
path?: string;
|
|
8
|
+
fn: string;
|
|
9
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customImport } from "../import.js";
|
|
2
|
+
import { expect } from "vitest";
|
|
3
|
+
//#region src/build-tests/imports/helper.ts
|
|
4
|
+
const helperFn = async ({ path, fn }) => {
|
|
5
|
+
const _fn = await customImport({
|
|
6
|
+
path,
|
|
7
|
+
fn: (m) => m[fn]
|
|
8
|
+
});
|
|
9
|
+
expect(_fn).toBeDefined();
|
|
10
|
+
expect(_fn).toBeTypeOf("function");
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { helperFn };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","names":[],"sources":["../../../src/build-tests/imports/helper.ts"],"sourcesContent":["import { expect } from 'vitest';\nimport type { Fn } from '../../vitest-extended/bemedev/globals/types';\nimport { customImport } from '../import';\n\nexport type Helper_F = (args: {\n path?: string;\n fn: string;\n}) => Promise<void>;\n\nexport const helperFn = async <T extends Fn = Fn>({\n path,\n fn,\n}: {\n path?: string;\n fn: string;\n}) => {\n const _fn = await customImport<T>({ path, fn: m => m[fn] });\n expect(_fn).toBeDefined();\n expect(_fn).toBeTypeOf('function');\n};\n"],"mappings":";;;AASA,MAAa,WAAW,OAA0B,EAChD,MACA,SAII;CACJ,MAAM,MAAM,MAAM,aAAgB;EAAE;EAAM,KAAI,MAAK,EAAE;EAAK,CAAC;AAC3D,QAAO,IAAI,CAAC,aAAa;AACzB,QAAO,IAAI,CAAC,WAAW,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create';
|
|
@@ -3,7 +3,10 @@ const require_build_tests_constants = require("./constants.cjs");
|
|
|
3
3
|
const require_build_tests_addTarball = require("./addTarball.cjs");
|
|
4
4
|
const require_build_tests_cleanup = require("./cleanup.cjs");
|
|
5
5
|
const require_build_tests_import = require("./import.cjs");
|
|
6
|
+
const require_build_tests_imports_create = require("./imports/create.cjs");
|
|
7
|
+
require("./imports/index.cjs");
|
|
6
8
|
exports.THIS1 = require_build_tests_constants.THIS1;
|
|
7
9
|
exports.addTarball = require_build_tests_addTarball.addTarball;
|
|
8
10
|
exports.cleanup = require_build_tests_cleanup.cleanup;
|
|
11
|
+
exports.createImportFnTests = require_build_tests_imports_create.createImportFnTests;
|
|
9
12
|
exports.customImport = require_build_tests_import.customImport;
|
package/lib/build-tests/index.js
CHANGED
|
@@ -2,4 +2,6 @@ import { THIS1 } from "./constants.js";
|
|
|
2
2
|
import { addTarball } from "./addTarball.js";
|
|
3
3
|
import { cleanup } from "./cleanup.js";
|
|
4
4
|
import { customImport } from "./import.js";
|
|
5
|
-
|
|
5
|
+
import { createImportFnTests } from "./imports/create.js";
|
|
6
|
+
import "./imports/index.js";
|
|
7
|
+
export { THIS1, addTarball, cleanup, createImportFnTests, customImport };
|
|
@@ -5,10 +5,10 @@ let vitest = require("vitest");
|
|
|
5
5
|
//#region src/vitest-extended/acceptation.ts
|
|
6
6
|
const useTestFunctionAcceptation = (f, _name) => {
|
|
7
7
|
const name = _name ?? f.name;
|
|
8
|
-
(0, vitest.test)(`#
|
|
8
|
+
(0, vitest.test)(`#01 => ${name} is defined`, () => {
|
|
9
9
|
(0, vitest.expect)(f).toBeDefined();
|
|
10
10
|
});
|
|
11
|
-
(0, vitest.test)(`#
|
|
11
|
+
(0, vitest.test)(`#02 => ${name} is a function`, () => {
|
|
12
12
|
(0, vitest.expect)(require_vitest_extended_isFunction.isFunction(f)).toBe(true);
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptation.cjs","names":["isFunction"],"sources":["../../src/vitest-extended/acceptation.ts"],"sourcesContent":["import type { Fn } from './bemedev/globals/types';\nimport { expect, test } from 'vitest';\nimport { isFunction } from './isFunction';\n\nexport const useTestFunctionAcceptation = (f: Fn, _name?: string) => {\n const name = _name ?? f.name;\n\n test(`#
|
|
1
|
+
{"version":3,"file":"acceptation.cjs","names":["isFunction"],"sources":["../../src/vitest-extended/acceptation.ts"],"sourcesContent":["import type { Fn } from './bemedev/globals/types';\nimport { expect, test } from 'vitest';\nimport { isFunction } from './isFunction';\n\nexport const useTestFunctionAcceptation = (f: Fn, _name?: string) => {\n const name = _name ?? f.name;\n\n test(`#01 => ${name} is defined`, () => {\n expect(f).toBeDefined();\n });\n test(`#02 => ${name} is a function`, () => {\n const check = isFunction(f);\n expect(check).toBe(true);\n });\n};\n\n/**\n * For test only\n * useTestFunctionAcceptation\n */\nexport const useTFA = useTestFunctionAcceptation;\n"],"mappings":";;;;;AAIA,MAAa,8BAA8B,GAAO,UAAmB;CACnE,MAAM,OAAO,SAAS,EAAE;AAExB,EAAA,GAAA,OAAA,MAAK,UAAU,KAAK,oBAAoB;AACtC,GAAA,GAAA,OAAA,QAAO,EAAE,CAAC,aAAa;GACvB;AACF,EAAA,GAAA,OAAA,MAAK,UAAU,KAAK,uBAAuB;AAEzC,GAAA,GAAA,OAAA,QADcA,mCAAAA,WAAW,EACb,CAAC,CAAC,KAAK,KAAK;GACxB;;;;;;AAOJ,MAAa,SAAS"}
|
|
@@ -3,10 +3,10 @@ import { expect, test } from "vitest";
|
|
|
3
3
|
//#region src/vitest-extended/acceptation.ts
|
|
4
4
|
const useTestFunctionAcceptation = (f, _name) => {
|
|
5
5
|
const name = _name ?? f.name;
|
|
6
|
-
test(`#
|
|
6
|
+
test(`#01 => ${name} is defined`, () => {
|
|
7
7
|
expect(f).toBeDefined();
|
|
8
8
|
});
|
|
9
|
-
test(`#
|
|
9
|
+
test(`#02 => ${name} is a function`, () => {
|
|
10
10
|
expect(isFunction(f)).toBe(true);
|
|
11
11
|
});
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptation.js","names":[],"sources":["../../src/vitest-extended/acceptation.ts"],"sourcesContent":["import type { Fn } from './bemedev/globals/types';\nimport { expect, test } from 'vitest';\nimport { isFunction } from './isFunction';\n\nexport const useTestFunctionAcceptation = (f: Fn, _name?: string) => {\n const name = _name ?? f.name;\n\n test(`#
|
|
1
|
+
{"version":3,"file":"acceptation.js","names":[],"sources":["../../src/vitest-extended/acceptation.ts"],"sourcesContent":["import type { Fn } from './bemedev/globals/types';\nimport { expect, test } from 'vitest';\nimport { isFunction } from './isFunction';\n\nexport const useTestFunctionAcceptation = (f: Fn, _name?: string) => {\n const name = _name ?? f.name;\n\n test(`#01 => ${name} is defined`, () => {\n expect(f).toBeDefined();\n });\n test(`#02 => ${name} is a function`, () => {\n const check = isFunction(f);\n expect(check).toBe(true);\n });\n};\n\n/**\n * For test only\n * useTestFunctionAcceptation\n */\nexport const useTFA = useTestFunctionAcceptation;\n"],"mappings":";;;AAIA,MAAa,8BAA8B,GAAO,UAAmB;CACnE,MAAM,OAAO,SAAS,EAAE;AAExB,MAAK,UAAU,KAAK,oBAAoB;AACtC,SAAO,EAAE,CAAC,aAAa;GACvB;AACF,MAAK,UAAU,KAAK,uBAAuB;AAEzC,SADc,WAAW,EACb,CAAC,CAAC,KAAK,KAAK;GACxB;;;;;;AAOJ,MAAa,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemedev/dev-utils",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "A collection of utilities for Node.js development, including build tools, testing utilities, and configuration management.",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "bri_lvi@icloud.com",
|
|
@@ -151,26 +151,24 @@
|
|
|
151
151
|
"globals": "^17.5.0",
|
|
152
152
|
"husky": "^9.1.7",
|
|
153
153
|
"is-in-ci": "^2.0.0",
|
|
154
|
-
"jsdom": "^29.0.2",
|
|
155
154
|
"onchange": "^7.1.0",
|
|
156
155
|
"oxfmt": "^0.46.0",
|
|
157
156
|
"oxlint": "^1.61.0",
|
|
158
|
-
"prettier": "^3.8.3",
|
|
159
157
|
"pretty-quick": "^4.2.2",
|
|
160
158
|
"rolldown": "1.0.0-rc.17",
|
|
161
|
-
"rxjs": "^7.8.2",
|
|
162
159
|
"size-limit": "^12.1.0",
|
|
163
|
-
"solid-js": "^1.9.12",
|
|
164
160
|
"tslib": "^2.8.1",
|
|
165
161
|
"tsx": "^4.21.0",
|
|
166
162
|
"typescript": "^6.0.3",
|
|
167
163
|
"vitest": "4.1.5",
|
|
168
|
-
"zod": "^4.3.6"
|
|
164
|
+
"zod": "^4.3.6",
|
|
165
|
+
"zx": "^8.8.5"
|
|
169
166
|
},
|
|
170
167
|
"peerDependencies": {
|
|
171
|
-
"@vitest/coverage-v8": "4.1.
|
|
172
|
-
"
|
|
168
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
169
|
+
"@vitest/ui": "4.1.5",
|
|
170
|
+
"rolldown": "1.0.0-rc.17",
|
|
173
171
|
"typescript": "^6.0.3",
|
|
174
|
-
"vitest": "4.1.
|
|
172
|
+
"vitest": "4.1.5"
|
|
175
173
|
}
|
|
176
174
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type IndexImport = any;
|