@yaasl/utils 0.7.0 → 0.8.0-alpha.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.
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
1
|
export declare const mockConsole: () => {
|
|
3
|
-
error:
|
|
4
|
-
warn:
|
|
2
|
+
error: import("@vitest/spy").Mock<unknown[], unknown>;
|
|
3
|
+
warn: import("@vitest/spy").Mock<unknown[], unknown>;
|
|
5
4
|
resetConsole: () => Console;
|
|
6
5
|
};
|
package/dist/cjs/mockConsole.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mockConsole = void 0;
|
|
4
4
|
const mockConsole = () => {
|
|
5
5
|
const oldConsole = global.console;
|
|
6
|
-
const error =
|
|
7
|
-
const warn =
|
|
6
|
+
const error = vi.fn();
|
|
7
|
+
const warn = vi.fn();
|
|
8
8
|
global.console = Object.assign(Object.assign({}, global.console), { error, warn });
|
|
9
9
|
return { error, warn, resetConsole: () => (global.console = oldConsole) };
|
|
10
10
|
};
|
package/dist/mjs/mockConsole.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const mockConsole = () => {
|
|
2
2
|
const oldConsole = global.console;
|
|
3
|
-
const error =
|
|
4
|
-
const warn =
|
|
3
|
+
const error = vi.fn();
|
|
4
|
+
const warn = vi.fn();
|
|
5
5
|
global.console = { ...global.console, error, warn };
|
|
6
6
|
return { error, warn, resetConsole: () => (global.console = oldConsole) };
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaasl/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-alpha.1",
|
|
4
4
|
"description": "Utilities for @yaasl packages",
|
|
5
5
|
"author": "PrettyCoffee",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,16 +26,12 @@
|
|
|
26
26
|
"compile:mjs": "tsc -p ./tsconfig.node.json --outDir ./dist/mjs -m es2020 -t es2020",
|
|
27
27
|
"compile:cjs": "tsc -p ./tsconfig.node.json --outDir ./dist/cjs -m commonjs -t es2015",
|
|
28
28
|
"compile:types": "tsc -p ./tsconfig.node.json --outDir ./dist/@types --declaration --emitDeclarationOnly",
|
|
29
|
-
"test": "
|
|
30
|
-
"test:watch": "
|
|
29
|
+
"test": "vitest run --passWithNoTests",
|
|
30
|
+
"test:watch": "vitest watch --passWithNoTests",
|
|
31
31
|
"lint": "eslint ./src",
|
|
32
32
|
"lint:fix": "eslint ./src --fix",
|
|
33
33
|
"validate": "run-s lint test build"
|
|
34
34
|
},
|
|
35
|
-
"jest": {
|
|
36
|
-
"preset": "ts-jest",
|
|
37
|
-
"testEnvironment": "jsdom"
|
|
38
|
-
},
|
|
39
35
|
"eslintConfig": {
|
|
40
36
|
"extends": [
|
|
41
37
|
"../../.eslintrc"
|