@noma.to/qwik-mock 1.1.0 → 1.1.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/lib/lib/qwik-mock.cjs +3 -3
- package/lib/lib/qwik-mock.mjs +1 -1
- package/package.json +7 -6
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -83
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -83
- package/lib/node_modules/.pnpm/@vitest_expect@4.0.18/node_modules/@vitest/expect/dist/index.cjs +0 -1785
- package/lib/node_modules/.pnpm/@vitest_expect@4.0.18/node_modules/@vitest/expect/dist/index.mjs +0 -1785
- package/lib/node_modules/.pnpm/@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.cjs +0 -964
- package/lib/node_modules/.pnpm/@vitest_pretty-format@4.0.18/node_modules/@vitest/pretty-format/dist/index.mjs +0 -964
- package/lib/node_modules/.pnpm/@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/chunk-tasks.cjs +0 -60
- package/lib/node_modules/.pnpm/@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/chunk-tasks.mjs +0 -60
- package/lib/node_modules/.pnpm/@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/index.cjs +0 -1102
- package/lib/node_modules/.pnpm/@vitest_runner@4.0.18/node_modules/@vitest/runner/dist/index.mjs +0 -1102
- package/lib/node_modules/.pnpm/@vitest_snapshot@4.0.18/node_modules/@vitest/snapshot/dist/index.cjs +0 -1289
- package/lib/node_modules/.pnpm/@vitest_snapshot@4.0.18/node_modules/@vitest/snapshot/dist/index.mjs +0 -1289
- package/lib/node_modules/.pnpm/@vitest_spy@4.0.18/node_modules/@vitest/spy/dist/index.cjs +0 -422
- package/lib/node_modules/.pnpm/@vitest_spy@4.0.18/node_modules/@vitest/spy/dist/index.mjs +0 -422
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.cjs +0 -6
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.mjs +0 -6
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.cjs +0 -98
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +0 -98
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/diff.cjs +0 -1626
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/diff.mjs +0 -1626
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/display.cjs +0 -690
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/display.mjs +0 -690
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/error.cjs +0 -39
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/error.mjs +0 -39
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/helpers.cjs +0 -151
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/helpers.mjs +0 -151
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/serialize.cjs +0 -114
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/serialize.mjs +0 -114
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/source-map.cjs +0 -125
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/source-map.mjs +0 -125
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/timers.cjs +0 -22
- package/lib/node_modules/.pnpm/@vitest_utils@4.0.18/node_modules/@vitest/utils/dist/timers.mjs +0 -22
- package/lib/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.cjs +0 -4056
- package/lib/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs +0 -4056
- package/lib/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -994
- package/lib/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -994
- package/lib/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +0 -101
- package/lib/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -101
- package/lib/node_modules/.pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.cjs +0 -84
- package/lib/node_modules/.pnpm/tinyrainbow@3.0.3/node_modules/tinyrainbow/dist/index.mjs +0 -84
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.cjs +0 -4
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +0 -4
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.cjs +0 -51
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.mjs +0 -51
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/utils.DvEY5TfP.cjs +0 -45
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/utils.DvEY5TfP.mjs +0 -45
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/vi.2VT5v0um.cjs +0 -2609
- package/lib/node_modules/.pnpm/vitest@4.0.18_@types_node@25.1.0_@vitest_ui@4.0.18_happy-dom@20.0.11_jiti@2.4.2_jsdom@26.1.0__pd2l5poczrcnqygjcqiguyknnm/node_modules/vitest/dist/chunks/vi.2VT5v0um.mjs +0 -2609
package/lib/lib/qwik-mock.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
|
-
const
|
|
4
|
+
const vitest = require("vitest");
|
|
5
5
|
function mockQrl(implQrl) {
|
|
6
|
-
const mockFn =
|
|
6
|
+
const mockFn = vitest.vi.fn(implQrl?.resolved);
|
|
7
7
|
if (implQrl && !mockFn.getMockImplementation()) {
|
|
8
8
|
implQrl.resolve().then((impl) => mockFn.mockImplementation(impl));
|
|
9
9
|
}
|
|
@@ -25,7 +25,7 @@ function mock$(impl) {
|
|
|
25
25
|
return mockQrl(impl ? qwik.$(impl) : void 0);
|
|
26
26
|
}
|
|
27
27
|
function clearAllMocks() {
|
|
28
|
-
|
|
28
|
+
vitest.vi.clearAllMocks();
|
|
29
29
|
}
|
|
30
30
|
exports.clearAllMocks = clearAllMocks;
|
|
31
31
|
exports.mock$ = mock$;
|
package/lib/lib/qwik-mock.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ } from "@builder.io/qwik";
|
|
2
|
-
import {
|
|
2
|
+
import { vi } from "vitest";
|
|
3
3
|
function mockQrl(implQrl) {
|
|
4
4
|
const mockFn = vi.fn(implQrl?.resolved);
|
|
5
5
|
if (implQrl && !mockFn.getMockImplementation()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noma.to/qwik-mock",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Small utility to mock Qwik QRLs",
|
|
5
5
|
"repository": "https://github.com/ianlet/qwik-testing-library",
|
|
6
6
|
"homepage": "https://github.com/ianlet/qwik-testing-library",
|
|
@@ -34,19 +34,20 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/eslint": "8.56.10",
|
|
37
|
-
"@types/node": "25.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
39
|
-
"@typescript-eslint/parser": "8.
|
|
37
|
+
"@types/node": "25.3.3",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "8.56.1",
|
|
39
|
+
"@typescript-eslint/parser": "8.56.1",
|
|
40
40
|
"eslint": "8.57.1",
|
|
41
41
|
"eslint-plugin-qwik": "1.19.0",
|
|
42
42
|
"prettier": "3.8.1",
|
|
43
43
|
"typescript": "5.9.3",
|
|
44
44
|
"undici": "*",
|
|
45
45
|
"vite": "7.3.1",
|
|
46
|
-
"vite-tsconfig-paths": "^6.
|
|
46
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
47
47
|
"vitest": "^4.0.18"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@builder.io/qwik": ">= 1.12.0 < 2"
|
|
50
|
+
"@builder.io/qwik": ">= 1.12.0 < 2",
|
|
51
|
+
"vitest": ">= 3.0.0"
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
var comma = ",".charCodeAt(0);
|
|
4
|
-
var semicolon = ";".charCodeAt(0);
|
|
5
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
|
-
var intToChar = new Uint8Array(64);
|
|
7
|
-
var 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) clamped |= 32;
|
|
20
|
-
builder.write(intToChar[clamped]);
|
|
21
|
-
} while (delta > 0);
|
|
22
|
-
return num;
|
|
23
|
-
}
|
|
24
|
-
var bufLength = 1024 * 16;
|
|
25
|
-
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
26
|
-
decode(buf) {
|
|
27
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
28
|
-
return out.toString();
|
|
29
|
-
}
|
|
30
|
-
} : {
|
|
31
|
-
decode(buf) {
|
|
32
|
-
let out = "";
|
|
33
|
-
for (let i = 0; i < buf.length; i++) {
|
|
34
|
-
out += String.fromCharCode(buf[i]);
|
|
35
|
-
}
|
|
36
|
-
return out;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var StringWriter = class {
|
|
40
|
-
constructor() {
|
|
41
|
-
this.pos = 0;
|
|
42
|
-
this.out = "";
|
|
43
|
-
this.buffer = new Uint8Array(bufLength);
|
|
44
|
-
}
|
|
45
|
-
write(v) {
|
|
46
|
-
const { buffer } = this;
|
|
47
|
-
buffer[this.pos++] = v;
|
|
48
|
-
if (this.pos === bufLength) {
|
|
49
|
-
this.out += td.decode(buffer);
|
|
50
|
-
this.pos = 0;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
flush() {
|
|
54
|
-
const { buffer, out, pos } = this;
|
|
55
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
function encode(decoded) {
|
|
59
|
-
const writer = new StringWriter();
|
|
60
|
-
let sourcesIndex = 0;
|
|
61
|
-
let sourceLine = 0;
|
|
62
|
-
let sourceColumn = 0;
|
|
63
|
-
let namesIndex = 0;
|
|
64
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
65
|
-
const line = decoded[i];
|
|
66
|
-
if (i > 0) writer.write(semicolon);
|
|
67
|
-
if (line.length === 0) continue;
|
|
68
|
-
let genColumn = 0;
|
|
69
|
-
for (let j = 0; j < line.length; j++) {
|
|
70
|
-
const segment = line[j];
|
|
71
|
-
if (j > 0) writer.write(comma);
|
|
72
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
73
|
-
if (segment.length === 1) continue;
|
|
74
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
75
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
76
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
77
|
-
if (segment.length === 4) continue;
|
|
78
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return writer.flush();
|
|
82
|
-
}
|
|
83
|
-
exports.encode = encode;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
var comma = ",".charCodeAt(0);
|
|
2
|
-
var semicolon = ";".charCodeAt(0);
|
|
3
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
4
|
-
var intToChar = new Uint8Array(64);
|
|
5
|
-
var 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) clamped |= 32;
|
|
18
|
-
builder.write(intToChar[clamped]);
|
|
19
|
-
} while (delta > 0);
|
|
20
|
-
return num;
|
|
21
|
-
}
|
|
22
|
-
var bufLength = 1024 * 16;
|
|
23
|
-
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
24
|
-
decode(buf) {
|
|
25
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
26
|
-
return out.toString();
|
|
27
|
-
}
|
|
28
|
-
} : {
|
|
29
|
-
decode(buf) {
|
|
30
|
-
let out = "";
|
|
31
|
-
for (let i = 0; i < buf.length; i++) {
|
|
32
|
-
out += String.fromCharCode(buf[i]);
|
|
33
|
-
}
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var StringWriter = class {
|
|
38
|
-
constructor() {
|
|
39
|
-
this.pos = 0;
|
|
40
|
-
this.out = "";
|
|
41
|
-
this.buffer = new Uint8Array(bufLength);
|
|
42
|
-
}
|
|
43
|
-
write(v) {
|
|
44
|
-
const { buffer } = this;
|
|
45
|
-
buffer[this.pos++] = v;
|
|
46
|
-
if (this.pos === bufLength) {
|
|
47
|
-
this.out += td.decode(buffer);
|
|
48
|
-
this.pos = 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
flush() {
|
|
52
|
-
const { buffer, out, pos } = this;
|
|
53
|
-
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
function encode(decoded) {
|
|
57
|
-
const writer = new StringWriter();
|
|
58
|
-
let sourcesIndex = 0;
|
|
59
|
-
let sourceLine = 0;
|
|
60
|
-
let sourceColumn = 0;
|
|
61
|
-
let namesIndex = 0;
|
|
62
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
63
|
-
const line = decoded[i];
|
|
64
|
-
if (i > 0) writer.write(semicolon);
|
|
65
|
-
if (line.length === 0) continue;
|
|
66
|
-
let genColumn = 0;
|
|
67
|
-
for (let j = 0; j < line.length; j++) {
|
|
68
|
-
const segment = line[j];
|
|
69
|
-
if (j > 0) writer.write(comma);
|
|
70
|
-
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
71
|
-
if (segment.length === 1) continue;
|
|
72
|
-
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
73
|
-
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
74
|
-
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
75
|
-
if (segment.length === 4) continue;
|
|
76
|
-
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return writer.flush();
|
|
80
|
-
}
|
|
81
|
-
export {
|
|
82
|
-
encode
|
|
83
|
-
};
|