@noma.to/qwik-testing-library 1.3.0 → 1.3.2
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/README.md +12 -2
- package/lib/index.qwik.cjs +0 -4
- package/lib/index.qwik.mjs +0 -4
- package/lib/lib/qwik-testing-library.qwik.cjs +1 -5
- package/lib/lib/qwik-testing-library.qwik.mjs +2 -6
- package/lib/lib/qwikloader.qwik.cjs +1 -1
- package/lib/lib/qwikloader.qwik.mjs +1 -1
- package/lib-types/lib/qwik-testing-library.d.ts +1 -2
- package/package.json +9 -9
- package/lib/lib/mock.qwik.cjs +0 -14
- package/lib/lib/mock.qwik.mjs +0 -14
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs +0 -89
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs +0 -89
- package/lib/node_modules/.pnpm/@vitest_expect@2.1.8/node_modules/@vitest/expect/dist/index.qwik.cjs +0 -2051
- package/lib/node_modules/.pnpm/@vitest_expect@2.1.8/node_modules/@vitest/expect/dist/index.qwik.mjs +0 -2051
- package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.8/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +0 -1208
- package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.8/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +0 -1208
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +0 -44
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +0 -44
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/index.qwik.cjs +0 -671
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/index.qwik.mjs +0 -671
- package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.8/node_modules/@vitest/snapshot/dist/index.qwik.cjs +0 -2044
- package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.8/node_modules/@vitest/snapshot/dist/index.qwik.mjs +0 -2044
- package/lib/node_modules/.pnpm/@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.cjs +0 -148
- package/lib/node_modules/.pnpm/@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.mjs +0 -148
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs +0 -162
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs +0 -162
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.cjs +0 -1739
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.mjs +0 -1739
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.cjs +0 -137
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.mjs +0 -137
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.cjs +0 -150
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.mjs +0 -150
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.cjs +0 -472
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.mjs +0 -472
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/source-map.qwik.cjs +0 -216
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/source-map.qwik.mjs +0 -216
- package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.cjs +0 -3937
- package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.mjs +0 -3937
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/arguments.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/arguments.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/array.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/array.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/bigint.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/bigint.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/class.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/class.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/date.qwik.cjs +0 -12
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/date.qwik.mjs +0 -13
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/error.qwik.cjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/error.qwik.mjs +0 -37
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/function.qwik.cjs +0 -11
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/function.qwik.mjs +0 -12
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/helpers.qwik.cjs +0 -160
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/helpers.qwik.mjs +0 -160
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/html.qwik.cjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/html.qwik.mjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/index.qwik.cjs +0 -130
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/index.qwik.mjs +0 -130
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/map.qwik.cjs +0 -25
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/map.qwik.mjs +0 -26
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/number.qwik.cjs +0 -19
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/number.qwik.mjs +0 -20
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/object.qwik.cjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/object.qwik.mjs +0 -25
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/promise.qwik.cjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/promise.qwik.mjs +0 -18
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/regexp.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/regexp.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/set.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/set.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/string.qwik.cjs +0 -23
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/string.qwik.mjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/symbol.qwik.cjs +0 -8
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/symbol.qwik.mjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/typedarray.qwik.cjs +0 -34
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/typedarray.qwik.mjs +0 -35
- package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.cjs +0 -979
- package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.mjs +0 -979
- package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs +0 -101
- package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs +0 -101
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +0 -7
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +0 -8
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +0 -80
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +0 -80
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +0 -104
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +0 -104
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +0 -8
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +0 -8
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +0 -56
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +0 -56
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +0 -66
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +0 -66
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs +0 -2749
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs +0 -2749
- package/lib-types/lib/mock.d.ts +0 -34
package/README.md
CHANGED
|
@@ -318,17 +318,27 @@ describe("<Counter />", () => {
|
|
|
318
318
|
> This feature is under a testing phase and thus experimental.
|
|
319
319
|
> Its API may change in the future, so use it at your own risk.
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
#### Setup
|
|
322
|
+
|
|
323
|
+
Optionally, you can install `@noma.to/qwik-mock` to mock callbacks of Qwik components. It provides a `mock$` function
|
|
322
324
|
that can be used to create a mock of a QRL and verify interactions on your Qwik components.
|
|
323
325
|
|
|
326
|
+
```shell
|
|
327
|
+
npm install --save-dev @noma.to/qwik-mock
|
|
328
|
+
```
|
|
329
|
+
|
|
324
330
|
It is _not_ a replacement of regular mocking functions (such as `vi.fn` and `vi.mock`) as its intended use is only for
|
|
325
331
|
testing callbacks of Qwik components.
|
|
326
332
|
|
|
333
|
+
#### Usage
|
|
334
|
+
|
|
327
335
|
Here's an example on how to use the `mock$` function:
|
|
328
336
|
|
|
329
337
|
```tsx title="counter.spec.tsx"
|
|
330
338
|
// import qwik-testing methods
|
|
331
|
-
import {
|
|
339
|
+
import {render, screen, waitFor} from "@noma.to/qwik-testing-library";
|
|
340
|
+
// import qwik-mock methods
|
|
341
|
+
import {mock$, clearAllMock} from "@noma.to/qwik-mock";
|
|
332
342
|
// import the userEvent methods to interact with the DOM
|
|
333
343
|
import {userEvent} from "@testing-library/user-event";
|
|
334
344
|
|
package/lib/index.qwik.cjs
CHANGED
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const qwikTestingLibrary = require("./lib/qwik-testing-library.qwik.cjs");
|
|
4
4
|
const dom = require("@testing-library/dom");
|
|
5
|
-
const mock = require("./lib/mock.qwik.cjs");
|
|
6
5
|
exports.cleanup = qwikTestingLibrary.cleanup;
|
|
7
6
|
exports.render = qwikTestingLibrary.render;
|
|
8
|
-
exports.clearAllMocks = mock.clearAllMocks;
|
|
9
|
-
exports.mock$ = mock.mock$;
|
|
10
|
-
exports.mockQrl = mock.mockQrl;
|
|
11
7
|
Object.keys(dom).forEach((k) => {
|
|
12
8
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
13
9
|
enumerable: true,
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -25,7 +25,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
25
25
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
26
26
|
const dom = require("@testing-library/dom");
|
|
27
27
|
const qwikloader = require("./qwikloader.qwik.cjs");
|
|
28
|
-
const mock = require("./mock.qwik.cjs");
|
|
29
28
|
if (typeof process === "undefined" || !process.env?.QTL_SKIP_AUTO_CLEANUP) {
|
|
30
29
|
if (typeof afterEach === "function") {
|
|
31
30
|
afterEach(() => {
|
|
@@ -47,6 +46,7 @@ async function render(ui, options = {}) {
|
|
|
47
46
|
const wrappedUi = !Wrapper ? ui : /* @__PURE__ */ jsxRuntime.jsx(Wrapper, {
|
|
48
47
|
children: ui
|
|
49
48
|
});
|
|
49
|
+
qwikloader.qwikLoader(baseElement.ownerDocument);
|
|
50
50
|
const { cleanup: cleanup2 } = await qwik.render(container, wrappedUi, {
|
|
51
51
|
serverData
|
|
52
52
|
});
|
|
@@ -54,7 +54,6 @@ async function render(ui, options = {}) {
|
|
|
54
54
|
container,
|
|
55
55
|
componentCleanup: cleanup2
|
|
56
56
|
});
|
|
57
|
-
qwikloader.qwikLoader(baseElement.ownerDocument);
|
|
58
57
|
return {
|
|
59
58
|
container,
|
|
60
59
|
baseElement,
|
|
@@ -86,9 +85,6 @@ function cleanupAtContainer(ref) {
|
|
|
86
85
|
function cleanup() {
|
|
87
86
|
mountedContainers.forEach(cleanupAtContainer);
|
|
88
87
|
}
|
|
89
|
-
exports.clearAllMocks = mock.clearAllMocks;
|
|
90
|
-
exports.mock$ = mock.mock$;
|
|
91
|
-
exports.mockQrl = mock.mockQrl;
|
|
92
88
|
exports.cleanup = cleanup;
|
|
93
89
|
exports.render = render;
|
|
94
90
|
Object.keys(dom).forEach((k) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getQueriesForElement, prettyDOM } from "@testing-library/dom";
|
|
3
3
|
export * from "@testing-library/dom";
|
|
4
4
|
import { qwikLoader } from "./qwikloader.qwik.mjs";
|
|
5
|
-
import { clearAllMocks, mock$, mockQrl } from "./mock.qwik.mjs";
|
|
6
5
|
if (typeof process === "undefined" || !process.env?.QTL_SKIP_AUTO_CLEANUP) {
|
|
7
6
|
if (typeof afterEach === "function") {
|
|
8
7
|
afterEach(() => {
|
|
@@ -24,6 +23,7 @@ async function render(ui, options = {}) {
|
|
|
24
23
|
const wrappedUi = !Wrapper ? ui : /* @__PURE__ */ jsx(Wrapper, {
|
|
25
24
|
children: ui
|
|
26
25
|
});
|
|
26
|
+
qwikLoader(baseElement.ownerDocument);
|
|
27
27
|
const { cleanup: cleanup2 } = await qwik.render(container, wrappedUi, {
|
|
28
28
|
serverData
|
|
29
29
|
});
|
|
@@ -31,7 +31,6 @@ async function render(ui, options = {}) {
|
|
|
31
31
|
container,
|
|
32
32
|
componentCleanup: cleanup2
|
|
33
33
|
});
|
|
34
|
-
qwikLoader(baseElement.ownerDocument);
|
|
35
34
|
return {
|
|
36
35
|
container,
|
|
37
36
|
baseElement,
|
|
@@ -65,8 +64,5 @@ function cleanup() {
|
|
|
65
64
|
}
|
|
66
65
|
export {
|
|
67
66
|
cleanup,
|
|
68
|
-
clearAllMocks,
|
|
69
|
-
mock$,
|
|
70
|
-
mockQrl,
|
|
71
67
|
render
|
|
72
68
|
};
|
|
@@ -11,7 +11,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
|
11
11
|
value
|
|
12
12
|
}) : obj[key] = value;
|
|
13
13
|
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b) {
|
|
14
|
+
for (var prop in b || (b = {})) {
|
|
15
15
|
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
16
16
|
}
|
|
17
17
|
if (__getOwnPropSymbols) {
|
|
@@ -9,7 +9,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
|
9
9
|
value
|
|
10
10
|
}) : obj[key] = value;
|
|
11
11
|
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b) {
|
|
12
|
+
for (var prop in b || (b = {})) {
|
|
13
13
|
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
14
14
|
}
|
|
15
15
|
if (__getOwnPropSymbols) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { JSXOutput } from "@builder.io/qwik";
|
|
2
2
|
import type { Options, Result } from "./types";
|
|
3
|
-
import { clearAllMocks, mock$, mockQrl } from "./mock";
|
|
4
3
|
declare function render(ui: JSXOutput, options?: Options): Promise<Result>;
|
|
5
4
|
declare function cleanup(): void;
|
|
6
5
|
export * from "@testing-library/dom";
|
|
7
|
-
export { cleanup, render
|
|
6
|
+
export { cleanup, render };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noma.to/qwik-testing-library",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Simple and complete Qwik testing utilities that encourage good testing practices.",
|
|
5
5
|
"repository": "https://github.com/ianlet/qwik-testing-library",
|
|
6
6
|
"homepage": "https://github.com/ianlet/qwik-testing-library",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/eslint": "8.56.10",
|
|
38
|
-
"@types/node": "22.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
40
|
-
"@typescript-eslint/parser": "8.
|
|
38
|
+
"@types/node": "22.13.8",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "8.28.0",
|
|
40
|
+
"@typescript-eslint/parser": "8.28.0",
|
|
41
41
|
"eslint": "8.57.1",
|
|
42
|
-
"eslint-plugin-qwik": "1.12.
|
|
43
|
-
"prettier": "3.
|
|
44
|
-
"typescript": "5.
|
|
42
|
+
"eslint-plugin-qwik": "1.12.1",
|
|
43
|
+
"prettier": "3.5.3",
|
|
44
|
+
"typescript": "5.8.2",
|
|
45
45
|
"undici": "*",
|
|
46
|
-
"vite": "6.
|
|
46
|
+
"vite": "6.2.3",
|
|
47
47
|
"vite-tsconfig-paths": "^5.1.4",
|
|
48
|
-
"vitest": "^
|
|
48
|
+
"vitest": "^3.0.9"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@builder.io/qwik": ">= 1.12.0 < 2",
|
package/lib/lib/mock.qwik.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const qwik = require("@builder.io/qwik");
|
|
4
|
-
const vi_DgezovHB = require("../node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs");
|
|
5
|
-
const mockQrl = () => {
|
|
6
|
-
return qwik.$(vi_DgezovHB.v.fn());
|
|
7
|
-
};
|
|
8
|
-
const mock$ = qwik.implicit$FirstArg(mockQrl);
|
|
9
|
-
function clearAllMocks() {
|
|
10
|
-
vi_DgezovHB.v.clearAllMocks();
|
|
11
|
-
}
|
|
12
|
-
exports.clearAllMocks = clearAllMocks;
|
|
13
|
-
exports.mock$ = mock$;
|
|
14
|
-
exports.mockQrl = mockQrl;
|
package/lib/lib/mock.qwik.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { implicit$FirstArg, $ } from "@builder.io/qwik";
|
|
2
|
-
import { v as vi } from "../node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs";
|
|
3
|
-
const mockQrl = () => {
|
|
4
|
-
return $(vi.fn());
|
|
5
|
-
};
|
|
6
|
-
const mock$ = implicit$FirstArg(mockQrl);
|
|
7
|
-
function clearAllMocks() {
|
|
8
|
-
vi.clearAllMocks();
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
clearAllMocks,
|
|
12
|
-
mock$,
|
|
13
|
-
mockQrl
|
|
14
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const comma = ",".charCodeAt(0);
|
|
4
|
-
const semicolon = ";".charCodeAt(0);
|
|
5
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
|
-
const intToChar = new Uint8Array(64);
|
|
7
|
-
const charToInt = new Uint8Array(128);
|
|
8
|
-
for (let i = 0; i < chars.length; i++) {
|
|
9
|
-
const c = chars.charCodeAt(i);
|
|
10
|
-
intToChar[i] = c;
|
|
11
|
-
charToInt[c] = i;
|
|
12
|
-
}
|
|
13
|
-
function encodeInteger(builder, num, relative) {
|
|
14
|
-
let delta = num - relative;
|
|
15
|
-
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
16
|
-
do {
|
|
17
|
-
let clamped = delta & 31;
|
|
18
|
-
delta >>>= 5;
|
|
19
|
-
if (delta > 0)
|
|
20
|
-
clamped |= 32;
|
|
21
|
-
builder.write(intToChar[clamped]);
|
|
22
|
-
} while (delta > 0);
|
|
23
|
-
return num;
|
|
24
|
-
}
|
|
25
|
-
const bufLength = 1024 * 16;
|
|
26
|
-
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
27
|
-
decode(buf) {
|
|
28
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
29
|
-
return out.toString();
|
|
30
|
-
}
|
|
31
|
-
} : {
|
|
32
|
-
decode(buf) {
|
|
33
|
-
let out = "";
|
|
34
|
-
for (let i = 0; i < buf.length; i++) {
|
|
35
|
-
out += String.fromCharCode(buf[i]);
|
|
36
|
-
}
|
|
37
|
-
return out;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
class StringWriter {
|
|
41
|
-
constructor() {
|
|
42
|
-
this.pos = 0;
|
|
43
|
-
this.out = "";
|
|
44
|
-
this.buffer = new Uint8Array(bufLength);
|
|
45
|
-
}
|
|
46
|
-
write(v) {
|
|
47
|
-
const { buffer } = this;
|
|
48
|
-
buffer[this.pos++] = v;
|
|
49
|
-
if (this.pos === bufLength) {
|
|
50
|
-
this.out += td.decode(buffer);
|
|
51
|
-
this.pos = 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
flush() {
|
|
55
|
-
const { buffer, out, pos } = this;
|
|
56
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function encode(decoded) {
|
|
60
|
-
const writer = new StringWriter();
|
|
61
|
-
let sourcesIndex = 0;
|
|
62
|
-
let sourceLine = 0;
|
|
63
|
-
let sourceColumn = 0;
|
|
64
|
-
let namesIndex = 0;
|
|
65
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
66
|
-
const line = decoded[i];
|
|
67
|
-
if (i > 0)
|
|
68
|
-
writer.write(semicolon);
|
|
69
|
-
if (line.length === 0)
|
|
70
|
-
continue;
|
|
71
|
-
let genColumn = 0;
|
|
72
|
-
for (let j = 0; j < line.length; j++) {
|
|
73
|
-
const segment = line[j];
|
|
74
|
-
if (j > 0)
|
|
75
|
-
writer.write(comma);
|
|
76
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
77
|
-
if (segment.length === 1)
|
|
78
|
-
continue;
|
|
79
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
80
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
81
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
82
|
-
if (segment.length === 4)
|
|
83
|
-
continue;
|
|
84
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return writer.flush();
|
|
88
|
-
}
|
|
89
|
-
exports.encode = encode;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const comma = ",".charCodeAt(0);
|
|
2
|
-
const semicolon = ";".charCodeAt(0);
|
|
3
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
4
|
-
const intToChar = new Uint8Array(64);
|
|
5
|
-
const charToInt = new Uint8Array(128);
|
|
6
|
-
for (let i = 0; i < chars.length; i++) {
|
|
7
|
-
const c = chars.charCodeAt(i);
|
|
8
|
-
intToChar[i] = c;
|
|
9
|
-
charToInt[c] = i;
|
|
10
|
-
}
|
|
11
|
-
function encodeInteger(builder, num, relative) {
|
|
12
|
-
let delta = num - relative;
|
|
13
|
-
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
14
|
-
do {
|
|
15
|
-
let clamped = delta & 31;
|
|
16
|
-
delta >>>= 5;
|
|
17
|
-
if (delta > 0)
|
|
18
|
-
clamped |= 32;
|
|
19
|
-
builder.write(intToChar[clamped]);
|
|
20
|
-
} while (delta > 0);
|
|
21
|
-
return num;
|
|
22
|
-
}
|
|
23
|
-
const bufLength = 1024 * 16;
|
|
24
|
-
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
25
|
-
decode(buf) {
|
|
26
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
27
|
-
return out.toString();
|
|
28
|
-
}
|
|
29
|
-
} : {
|
|
30
|
-
decode(buf) {
|
|
31
|
-
let out = "";
|
|
32
|
-
for (let i = 0; i < buf.length; i++) {
|
|
33
|
-
out += String.fromCharCode(buf[i]);
|
|
34
|
-
}
|
|
35
|
-
return out;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
class StringWriter {
|
|
39
|
-
constructor() {
|
|
40
|
-
this.pos = 0;
|
|
41
|
-
this.out = "";
|
|
42
|
-
this.buffer = new Uint8Array(bufLength);
|
|
43
|
-
}
|
|
44
|
-
write(v) {
|
|
45
|
-
const { buffer } = this;
|
|
46
|
-
buffer[this.pos++] = v;
|
|
47
|
-
if (this.pos === bufLength) {
|
|
48
|
-
this.out += td.decode(buffer);
|
|
49
|
-
this.pos = 0;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
flush() {
|
|
53
|
-
const { buffer, out, pos } = this;
|
|
54
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function encode(decoded) {
|
|
58
|
-
const writer = new StringWriter();
|
|
59
|
-
let sourcesIndex = 0;
|
|
60
|
-
let sourceLine = 0;
|
|
61
|
-
let sourceColumn = 0;
|
|
62
|
-
let namesIndex = 0;
|
|
63
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
64
|
-
const line = decoded[i];
|
|
65
|
-
if (i > 0)
|
|
66
|
-
writer.write(semicolon);
|
|
67
|
-
if (line.length === 0)
|
|
68
|
-
continue;
|
|
69
|
-
let genColumn = 0;
|
|
70
|
-
for (let j = 0; j < line.length; j++) {
|
|
71
|
-
const segment = line[j];
|
|
72
|
-
if (j > 0)
|
|
73
|
-
writer.write(comma);
|
|
74
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
75
|
-
if (segment.length === 1)
|
|
76
|
-
continue;
|
|
77
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
78
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
79
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
80
|
-
if (segment.length === 4)
|
|
81
|
-
continue;
|
|
82
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return writer.flush();
|
|
86
|
-
}
|
|
87
|
-
export {
|
|
88
|
-
encode
|
|
89
|
-
};
|