@rindo/core 4.18.3-dev.1734304270.ca7046f → 4.19.0
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/cli/index.cjs +43 -16
- package/cli/index.js +43 -16
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +64 -55
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +531 -507
- package/internal/client/package.json +3 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +104 -49
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +29 -11
- package/internal/hydrate/runner.js +235 -258
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +29 -10
- package/internal/rindo-public-compiler.d.ts +14 -0
- package/internal/rindo-public-runtime.d.ts +0 -2
- package/internal/testing/index.js +435 -406
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +133 -129
- package/mock-doc/index.d.ts +18 -4
- package/mock-doc/index.js +133 -129
- package/mock-doc/package.json +1 -1
- package/package.json +29 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +10 -10
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +68 -4
- package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
- package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
- package/testing/jest/jest-28/matchers/events.d.ts +4 -0
- package/testing/jest/jest-28/matchers/index.d.ts +2 -1
- package/testing/jest/jest-29/matchers/events.d.ts +4 -0
- package/testing/jest/jest-29/matchers/index.d.ts +2 -1
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo Testing v4.
|
|
2
|
+
Rindo Testing v4.19.0 | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
@@ -3343,6 +3343,26 @@ function toHaveFirstReceivedEventDetail(eventSpy, eventDetail) {
|
|
|
3343
3343
|
throw new Error(`event "${eventSpy.eventName}" was not received`);
|
|
3344
3344
|
}
|
|
3345
3345
|
const pass = deepEqual(eventSpy.firstEvent.detail, eventDetail);
|
|
3346
|
+
expect(eventSpy.firstEvent.detail).toEqual(eventDetail);
|
|
3347
|
+
return {
|
|
3348
|
+
message: () => `expected event "${eventSpy.eventName}" detail to ${pass ? "not " : ""}equal`,
|
|
3349
|
+
pass
|
|
3350
|
+
};
|
|
3351
|
+
}
|
|
3352
|
+
function toHaveLastReceivedEventDetail(eventSpy, eventDetail) {
|
|
3353
|
+
if (!eventSpy) {
|
|
3354
|
+
throw new Error(`toHaveLastReceivedEventDetail event spy is null`);
|
|
3355
|
+
}
|
|
3356
|
+
if (typeof eventSpy.then === "function") {
|
|
3357
|
+
throw new Error(`event spy must be a resolved value, not a promise, before it can be tested`);
|
|
3358
|
+
}
|
|
3359
|
+
if (!eventSpy.eventName) {
|
|
3360
|
+
throw new Error(`toHaveLastReceivedEventDetail did not receive an event spy`);
|
|
3361
|
+
}
|
|
3362
|
+
if (!eventSpy.firstEvent) {
|
|
3363
|
+
throw new Error(`event "${eventSpy.eventName}" was not received`);
|
|
3364
|
+
}
|
|
3365
|
+
const pass = deepEqual(eventSpy.lastEvent.detail, eventDetail);
|
|
3346
3366
|
expect(eventSpy.lastEvent.detail).toEqual(eventDetail);
|
|
3347
3367
|
return {
|
|
3348
3368
|
message: () => `expected event "${eventSpy.eventName}" detail to ${pass ? "not " : ""}equal`,
|
|
@@ -3568,6 +3588,7 @@ var expectExtend = {
|
|
|
3568
3588
|
toHaveReceivedEventDetail,
|
|
3569
3589
|
toHaveReceivedEventTimes,
|
|
3570
3590
|
toHaveFirstReceivedEventDetail,
|
|
3591
|
+
toHaveLastReceivedEventDetail,
|
|
3571
3592
|
toHaveNthReceivedEventDetail,
|
|
3572
3593
|
toMatchScreenshot
|
|
3573
3594
|
};
|
|
@@ -4355,6 +4376,26 @@ function toHaveFirstReceivedEventDetail2(eventSpy, eventDetail) {
|
|
|
4355
4376
|
throw new Error(`event "${eventSpy.eventName}" was not received`);
|
|
4356
4377
|
}
|
|
4357
4378
|
const pass = deepEqual2(eventSpy.firstEvent.detail, eventDetail);
|
|
4379
|
+
expect(eventSpy.firstEvent.detail).toEqual(eventDetail);
|
|
4380
|
+
return {
|
|
4381
|
+
message: () => `expected event "${eventSpy.eventName}" detail to ${pass ? "not " : ""}equal`,
|
|
4382
|
+
pass
|
|
4383
|
+
};
|
|
4384
|
+
}
|
|
4385
|
+
function toHaveLastReceivedEventDetail2(eventSpy, eventDetail) {
|
|
4386
|
+
if (!eventSpy) {
|
|
4387
|
+
throw new Error(`toHaveLastReceivedEventDetail event spy is null`);
|
|
4388
|
+
}
|
|
4389
|
+
if (typeof eventSpy.then === "function") {
|
|
4390
|
+
throw new Error(`event spy must be a resolved value, not a promise, before it can be tested`);
|
|
4391
|
+
}
|
|
4392
|
+
if (!eventSpy.eventName) {
|
|
4393
|
+
throw new Error(`toHaveLastReceivedEventDetail did not receive an event spy`);
|
|
4394
|
+
}
|
|
4395
|
+
if (!eventSpy.firstEvent) {
|
|
4396
|
+
throw new Error(`event "${eventSpy.eventName}" was not received`);
|
|
4397
|
+
}
|
|
4398
|
+
const pass = deepEqual2(eventSpy.lastEvent.detail, eventDetail);
|
|
4358
4399
|
expect(eventSpy.lastEvent.detail).toEqual(eventDetail);
|
|
4359
4400
|
return {
|
|
4360
4401
|
message: () => `expected event "${eventSpy.eventName}" detail to ${pass ? "not " : ""}equal`,
|
|
@@ -4580,6 +4621,7 @@ var expectExtend2 = {
|
|
|
4580
4621
|
toHaveReceivedEventDetail: toHaveReceivedEventDetail2,
|
|
4581
4622
|
toHaveReceivedEventTimes: toHaveReceivedEventTimes2,
|
|
4582
4623
|
toHaveFirstReceivedEventDetail: toHaveFirstReceivedEventDetail2,
|
|
4624
|
+
toHaveLastReceivedEventDetail: toHaveLastReceivedEventDetail2,
|
|
4583
4625
|
toHaveNthReceivedEventDetail: toHaveNthReceivedEventDetail2,
|
|
4584
4626
|
toMatchScreenshot: toMatchScreenshot2
|
|
4585
4627
|
};
|
|
@@ -5358,6 +5400,26 @@ function toHaveFirstReceivedEventDetail3(eventSpy, eventDetail) {
|
|
|
5358
5400
|
throw new Error(`event "${eventSpy.eventName}" was not received`);
|
|
5359
5401
|
}
|
|
5360
5402
|
const pass = deepEqual3(eventSpy.firstEvent.detail, eventDetail);
|
|
5403
|
+
expect(eventSpy.firstEvent.detail).toEqual(eventDetail);
|
|
5404
|
+
return {
|
|
5405
|
+
message: () => `expected event "${eventSpy.eventName}" detail to ${pass ? "not " : ""}equal`,
|
|
5406
|
+
pass
|
|
5407
|
+
};
|
|
5408
|
+
}
|
|
5409
|
+
function toHaveLastReceivedEventDetail3(eventSpy, eventDetail) {
|
|
5410
|
+
if (!eventSpy) {
|
|
5411
|
+
throw new Error(`toHaveLastReceivedEventDetail event spy is null`);
|
|
5412
|
+
}
|
|
5413
|
+
if (typeof eventSpy.then === "function") {
|
|
5414
|
+
throw new Error(`event spy must be a resolved value, not a promise, before it can be tested`);
|
|
5415
|
+
}
|
|
5416
|
+
if (!eventSpy.eventName) {
|
|
5417
|
+
throw new Error(`toHaveLastReceivedEventDetail did not receive an event spy`);
|
|
5418
|
+
}
|
|
5419
|
+
if (!eventSpy.firstEvent) {
|
|
5420
|
+
throw new Error(`event "${eventSpy.eventName}" was not received`);
|
|
5421
|
+
}
|
|
5422
|
+
const pass = deepEqual3(eventSpy.lastEvent.detail, eventDetail);
|
|
5361
5423
|
expect(eventSpy.lastEvent.detail).toEqual(eventDetail);
|
|
5362
5424
|
return {
|
|
5363
5425
|
message: () => `expected event "${eventSpy.eventName}" detail to ${pass ? "not " : ""}equal`,
|
|
@@ -5583,6 +5645,7 @@ var expectExtend3 = {
|
|
|
5583
5645
|
toHaveReceivedEventDetail: toHaveReceivedEventDetail3,
|
|
5584
5646
|
toHaveReceivedEventTimes: toHaveReceivedEventTimes3,
|
|
5585
5647
|
toHaveFirstReceivedEventDetail: toHaveFirstReceivedEventDetail3,
|
|
5648
|
+
toHaveLastReceivedEventDetail: toHaveLastReceivedEventDetail3,
|
|
5586
5649
|
toHaveNthReceivedEventDetail: toHaveNthReceivedEventDetail3,
|
|
5587
5650
|
toMatchScreenshot: toMatchScreenshot3
|
|
5588
5651
|
};
|
|
@@ -6693,7 +6756,7 @@ var validateRollupConfig = (config) => {
|
|
|
6693
6756
|
if (rollupConfig.inputOptions && isObject(rollupConfig.inputOptions)) {
|
|
6694
6757
|
cleanRollupConfig = {
|
|
6695
6758
|
...cleanRollupConfig,
|
|
6696
|
-
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake"])
|
|
6759
|
+
inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake", "external"])
|
|
6697
6760
|
};
|
|
6698
6761
|
}
|
|
6699
6762
|
if (rollupConfig.outputOptions && isObject(rollupConfig.outputOptions)) {
|
|
@@ -10272,6 +10335,7 @@ async function newE2EPage(opts = {}) {
|
|
|
10272
10335
|
};
|
|
10273
10336
|
const failOnConsoleError = opts.failOnConsoleError === true;
|
|
10274
10337
|
const failOnNetworkError = opts.failOnNetworkError === true;
|
|
10338
|
+
const logFailingNetworkRequests = typeof opts.logFailingNetworkRequests === "boolean" ? opts.logFailingNetworkRequests : true;
|
|
10275
10339
|
page.on("console", (ev) => {
|
|
10276
10340
|
if (ev.type() === "error") {
|
|
10277
10341
|
diagnostics.push({
|
|
@@ -10301,7 +10365,7 @@ async function newE2EPage(opts = {}) {
|
|
|
10301
10365
|
});
|
|
10302
10366
|
if (failOnNetworkError) {
|
|
10303
10367
|
throw new Error(req.failure().errorText);
|
|
10304
|
-
} else {
|
|
10368
|
+
} else if (logFailingNetworkRequests) {
|
|
10305
10369
|
console.error("requestfailed", req.url());
|
|
10306
10370
|
}
|
|
10307
10371
|
});
|
|
@@ -10523,7 +10587,7 @@ var getBuildFeatures = (cmps) => {
|
|
|
10523
10587
|
member: cmps.some((c) => c.hasMember),
|
|
10524
10588
|
method: cmps.some((c) => c.hasMethod),
|
|
10525
10589
|
mode: cmps.some((c) => c.hasMode),
|
|
10526
|
-
observeAttribute: cmps.some((c) => c.hasAttribute),
|
|
10590
|
+
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
|
|
10527
10591
|
prop: cmps.some((c) => c.hasProp),
|
|
10528
10592
|
propBoolean: cmps.some((c) => c.hasPropBoolean),
|
|
10529
10593
|
propNumber: cmps.some((c) => c.hasPropNumber),
|
|
@@ -15,6 +15,10 @@ export declare function toHaveFirstReceivedEventDetail(eventSpy: d.EventSpy, eve
|
|
|
15
15
|
message: () => string;
|
|
16
16
|
pass: boolean;
|
|
17
17
|
};
|
|
18
|
+
export declare function toHaveLastReceivedEventDetail(eventSpy: d.EventSpy, eventDetail: any): {
|
|
19
|
+
message: () => string;
|
|
20
|
+
pass: boolean;
|
|
21
|
+
};
|
|
18
22
|
export declare function toHaveNthReceivedEventDetail(eventSpy: d.EventSpy, index: number, eventDetail: any): {
|
|
19
23
|
message: () => string;
|
|
20
24
|
pass: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toEqualAttribute, toEqualAttributes, toHaveAttribute } from './attributes';
|
|
2
2
|
import { toHaveClass, toHaveClasses, toMatchClasses } from './class-list';
|
|
3
|
-
import { toHaveFirstReceivedEventDetail, toHaveNthReceivedEventDetail, toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes } from './events';
|
|
3
|
+
import { toHaveFirstReceivedEventDetail, toHaveLastReceivedEventDetail, toHaveNthReceivedEventDetail, toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes } from './events';
|
|
4
4
|
import { toEqualHtml, toEqualLightHtml } from './html';
|
|
5
5
|
import { toMatchScreenshot } from './screenshot';
|
|
6
6
|
import { toEqualText } from './text';
|
|
@@ -18,6 +18,7 @@ export declare const expectExtend: {
|
|
|
18
18
|
toHaveReceivedEventDetail: typeof toHaveReceivedEventDetail;
|
|
19
19
|
toHaveReceivedEventTimes: typeof toHaveReceivedEventTimes;
|
|
20
20
|
toHaveFirstReceivedEventDetail: typeof toHaveFirstReceivedEventDetail;
|
|
21
|
+
toHaveLastReceivedEventDetail: typeof toHaveLastReceivedEventDetail;
|
|
21
22
|
toHaveNthReceivedEventDetail: typeof toHaveNthReceivedEventDetail;
|
|
22
23
|
toMatchScreenshot: typeof toMatchScreenshot;
|
|
23
24
|
};
|
|
@@ -15,6 +15,10 @@ export declare function toHaveFirstReceivedEventDetail(eventSpy: d.EventSpy, eve
|
|
|
15
15
|
message: () => string;
|
|
16
16
|
pass: boolean;
|
|
17
17
|
};
|
|
18
|
+
export declare function toHaveLastReceivedEventDetail(eventSpy: d.EventSpy, eventDetail: any): {
|
|
19
|
+
message: () => string;
|
|
20
|
+
pass: boolean;
|
|
21
|
+
};
|
|
18
22
|
export declare function toHaveNthReceivedEventDetail(eventSpy: d.EventSpy, index: number, eventDetail: any): {
|
|
19
23
|
message: () => string;
|
|
20
24
|
pass: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toEqualAttribute, toEqualAttributes, toHaveAttribute } from './attributes';
|
|
2
2
|
import { toHaveClass, toHaveClasses, toMatchClasses } from './class-list';
|
|
3
|
-
import { toHaveFirstReceivedEventDetail, toHaveNthReceivedEventDetail, toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes } from './events';
|
|
3
|
+
import { toHaveFirstReceivedEventDetail, toHaveLastReceivedEventDetail, toHaveNthReceivedEventDetail, toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes } from './events';
|
|
4
4
|
import { toEqualHtml, toEqualLightHtml } from './html';
|
|
5
5
|
import { toMatchScreenshot } from './screenshot';
|
|
6
6
|
import { toEqualText } from './text';
|
|
@@ -18,6 +18,7 @@ export declare const expectExtend: {
|
|
|
18
18
|
toHaveReceivedEventDetail: typeof toHaveReceivedEventDetail;
|
|
19
19
|
toHaveReceivedEventTimes: typeof toHaveReceivedEventTimes;
|
|
20
20
|
toHaveFirstReceivedEventDetail: typeof toHaveFirstReceivedEventDetail;
|
|
21
|
+
toHaveLastReceivedEventDetail: typeof toHaveLastReceivedEventDetail;
|
|
21
22
|
toHaveNthReceivedEventDetail: typeof toHaveNthReceivedEventDetail;
|
|
22
23
|
toMatchScreenshot: typeof toMatchScreenshot;
|
|
23
24
|
};
|
|
@@ -15,6 +15,10 @@ export declare function toHaveFirstReceivedEventDetail(eventSpy: d.EventSpy, eve
|
|
|
15
15
|
message: () => string;
|
|
16
16
|
pass: boolean;
|
|
17
17
|
};
|
|
18
|
+
export declare function toHaveLastReceivedEventDetail(eventSpy: d.EventSpy, eventDetail: any): {
|
|
19
|
+
message: () => string;
|
|
20
|
+
pass: boolean;
|
|
21
|
+
};
|
|
18
22
|
export declare function toHaveNthReceivedEventDetail(eventSpy: d.EventSpy, index: number, eventDetail: any): {
|
|
19
23
|
message: () => string;
|
|
20
24
|
pass: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toEqualAttribute, toEqualAttributes, toHaveAttribute } from './attributes';
|
|
2
2
|
import { toHaveClass, toHaveClasses, toMatchClasses } from './class-list';
|
|
3
|
-
import { toHaveFirstReceivedEventDetail, toHaveNthReceivedEventDetail, toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes } from './events';
|
|
3
|
+
import { toHaveFirstReceivedEventDetail, toHaveLastReceivedEventDetail, toHaveNthReceivedEventDetail, toHaveReceivedEvent, toHaveReceivedEventDetail, toHaveReceivedEventTimes } from './events';
|
|
4
4
|
import { toEqualHtml, toEqualLightHtml } from './html';
|
|
5
5
|
import { toMatchScreenshot } from './screenshot';
|
|
6
6
|
import { toEqualText } from './text';
|
|
@@ -18,6 +18,7 @@ export declare const expectExtend: {
|
|
|
18
18
|
toHaveReceivedEventDetail: typeof toHaveReceivedEventDetail;
|
|
19
19
|
toHaveReceivedEventTimes: typeof toHaveReceivedEventTimes;
|
|
20
20
|
toHaveFirstReceivedEventDetail: typeof toHaveFirstReceivedEventDetail;
|
|
21
|
+
toHaveLastReceivedEventDetail: typeof toHaveLastReceivedEventDetail;
|
|
21
22
|
toHaveNthReceivedEventDetail: typeof toHaveNthReceivedEventDetail;
|
|
22
23
|
toMatchScreenshot: typeof toMatchScreenshot;
|
|
23
24
|
};
|
package/testing/package.json
CHANGED
|
@@ -12,8 +12,19 @@ export type PageCloseOptions = {
|
|
|
12
12
|
export interface NewE2EPageOptions extends WaitForOptions {
|
|
13
13
|
url?: string;
|
|
14
14
|
html?: string;
|
|
15
|
+
/**
|
|
16
|
+
* If set to `true`, Rindo will throw an error if a console error occurs
|
|
17
|
+
*/
|
|
15
18
|
failOnConsoleError?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If set to `true`, Rindo will throw an error if a network request fails
|
|
21
|
+
*/
|
|
16
22
|
failOnNetworkError?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If set to `true`, Rindo will log failing network requests
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
logFailingNetworkRequests?: boolean;
|
|
17
28
|
}
|
|
18
29
|
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
19
30
|
type PuppeteerPage = Omit<Page, 'bringToFront' | 'browser' | 'screenshot' | 'emulate' | 'emulateMedia' | 'frames' | 'goBack' | 'goForward' | 'isClosed' | 'mainFrame' | 'pdf' | 'reload' | 'target' | 'title' | 'viewport' | 'waitForNavigation' | 'screenshot' | 'workers' | 'addListener' | 'prependListener' | 'prependOnceListener' | 'removeAllListeners' | 'setMaxListeners' | 'getMaxListeners' | 'listeners' | 'rawListeners' | 'emit' | 'eventNames' | 'listenerCount' | '$x' | 'waitForXPath'>;
|