html-browser-tester 0.0.14 → 0.0.16
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/.yarn/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-4a473b9b32.zip +0 -0
- package/.yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-a50a6818de.zip +0 -0
- package/.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip +0 -0
- package/.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip +0 -0
- package/.yarn/cache/abbrev-npm-1.1.1-3659247eab-a4a97ec07d.zip +0 -0
- package/.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip +0 -0
- package/.yarn/cache/agentkeepalive-npm-4.3.0-ac3d8e6807-982453aa44.zip +0 -0
- package/.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip +0 -0
- package/.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip +0 -0
- package/.yarn/cache/ansi-regex-npm-6.0.1-8d663a607d-1ff8b7667c.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-6.2.1-d43647018c-ef940f2f0c.zip +0 -0
- package/.yarn/cache/aproba-npm-2.0.0-8716bcfde6-5615cadcfb.zip +0 -0
- package/.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-52590c2486.zip +0 -0
- package/.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip +0 -0
- package/.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip +0 -0
- package/.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip +0 -0
- package/.yarn/cache/cacache-npm-17.1.3-f75f768a29-385756781e.zip +0 -0
- package/.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip +0 -0
- package/.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip +0 -0
- package/.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip +0 -0
- package/.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip +0 -0
- package/.yarn/cache/color-support-npm-1.1.3-3be5c53455-9b73568176.zip +0 -0
- package/.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip +0 -0
- package/.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip +0 -0
- package/.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip +0 -0
- package/.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip +0 -0
- package/.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip +0 -0
- package/.yarn/cache/depd-npm-2.0.0-b6c51a4b43-abbe19c768.zip +0 -0
- package/.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip +0 -0
- package/.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip +0 -0
- package/.yarn/cache/emoji-regex-npm-9.2.2-e6fac8d058-8487182da7.zip +0 -0
- package/.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip +0 -0
- package/.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip +0 -0
- package/.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip +0 -0
- package/.yarn/cache/esbuild-darwin-64-npm-0.15.13-cd6d2aa5ba-8.zip +0 -0
- package/.yarn/cache/esbuild-npm-0.15.13-7db36c1caa-ef5f339fae.zip +0 -0
- package/.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip +0 -0
- package/.yarn/cache/foreground-child-npm-3.1.1-77e78ed774-139d270bc8.zip +0 -0
- package/.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip +0 -0
- package/.yarn/cache/fs-minipass-npm-3.0.2-a27ef235f5-e9cc0e1f2d.zip +0 -0
- package/.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip +0 -0
- package/.yarn/cache/fsevents-npm-2.3.2-a881d6ac9f-97ade64e75.zip +0 -0
- package/.yarn/cache/fsevents-patch-2882183fbf-8.zip +0 -0
- package/.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip +0 -0
- package/.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip +0 -0
- package/.yarn/cache/glob-npm-10.3.0-da3187b4ef-6fa4ac0a86.zip +0 -0
- package/.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip +0 -0
- package/.yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-ac85f94da9.zip +0 -0
- package/.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip +0 -0
- package/.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip +0 -0
- package/.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip +0 -0
- package/.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-e2ee1ff165.zip +0 -0
- package/.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip +0 -0
- package/.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip +0 -0
- package/.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip +0 -0
- package/.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip +0 -0
- package/.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip +0 -0
- package/.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip +0 -0
- package/.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip +0 -0
- package/.yarn/cache/ip-npm-2.0.0-204facb3cc-cfcfac6b87.zip +0 -0
- package/.yarn/cache/is-core-module-npm-2.11.0-70061e141a-f96fd490c6.zip +0 -0
- package/.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip +0 -0
- package/.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip +0 -0
- package/.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip +0 -0
- package/.yarn/cache/jackspeak-npm-2.2.1-0644c98bfe-e29291c0d0.zip +0 -0
- package/.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip +0 -0
- package/.yarn/cache/lru-cache-npm-7.18.3-e68be5b11c-e550d77238.zip +0 -0
- package/.yarn/cache/lru-cache-npm-9.1.2-4846dc8c34-d3415634be.zip +0 -0
- package/.yarn/cache/make-fetch-happen-npm-11.1.1-f32b79aaaa-7268bf274a.zip +0 -0
- package/.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip +0 -0
- package/.yarn/cache/minimatch-npm-9.0.2-54f51f778f-2eb12e2047.zip +0 -0
- package/.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip +0 -0
- package/.yarn/cache/minipass-fetch-npm-3.0.3-2c4966d142-af5ab2552a.zip +0 -0
- package/.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip +0 -0
- package/.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip +0 -0
- package/.yarn/cache/minipass-npm-5.0.0-c64fb63c92-425dab2887.zip +0 -0
- package/.yarn/cache/minipass-npm-6.0.2-a7fca64b94-d140b91f4a.zip +0 -0
- package/.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip +0 -0
- package/.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip +0 -0
- package/.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip +0 -0
- package/.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip +0 -0
- package/.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip +0 -0
- package/.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip +0 -0
- package/.yarn/cache/nanoid-npm-3.3.4-3d250377d6-2fddd6dee9.zip +0 -0
- package/.yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip +0 -0
- package/.yarn/cache/node-gyp-npm-9.4.0-ebf5f5573e-78b404e2e0.zip +0 -0
- package/.yarn/cache/nopt-npm-6.0.0-5ea8050815-82149371f8.zip +0 -0
- package/.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-ae238cd264.zip +0 -0
- package/.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip +0 -0
- package/.yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip +0 -0
- package/.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip +0 -0
- package/.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip +0 -0
- package/.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip +0 -0
- package/.yarn/cache/path-scurry-npm-1.9.2-e4789f2bee-92888dfb68.zip +0 -0
- package/.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip +0 -0
- package/.yarn/cache/postcss-npm-8.4.19-164042496a-62782723a3.zip +0 -0
- package/.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip +0 -0
- package/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip +0 -0
- package/.yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip +0 -0
- package/.yarn/cache/resolve-patch-0c52e0e4f7-5656f4d0be.zip +0 -0
- package/.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip +0 -0
- package/.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip +0 -0
- package/.yarn/cache/rollup-npm-2.79.1-94e707a9a3-6a2bf167b3.zip +0 -0
- package/.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip +0 -0
- package/.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip +0 -0
- package/.yarn/cache/semver-npm-7.5.3-275095dbf3-9d58db1652.zip +0 -0
- package/.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-6e65a05f7c.zip +0 -0
- package/.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip +0 -0
- package/.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip +0 -0
- package/.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip +0 -0
- package/.yarn/cache/signal-exit-npm-4.0.2-e3f0e8ed25-41f5928431.zip +0 -0
- package/.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip +0 -0
- package/.yarn/cache/socks-npm-2.7.1-17f2b53052-259d9e3e8e.zip +0 -0
- package/.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-7205543701.zip +0 -0
- package/.yarn/cache/source-map-js-npm-1.0.2-ee4f9f9b30-c049a7fc4d.zip +0 -0
- package/.yarn/cache/ssri-npm-10.0.4-f583dafaf3-fb14da9f8a.zip +0 -0
- package/.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip +0 -0
- package/.yarn/cache/string-width-npm-5.1.2-bf60531341-7369deaa29.zip +0 -0
- package/.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip +0 -0
- package/.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip +0 -0
- package/.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-859c73fcf2.zip +0 -0
- package/.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip +0 -0
- package/.yarn/cache/tar-npm-6.1.15-44c3e71720-f23832fcee.zip +0 -0
- package/.yarn/cache/typescript-npm-4.8.4-9c0a335511-3e4f061658.zip +0 -0
- package/.yarn/cache/typescript-patch-6cdf00d327-c981e82b77.zip +0 -0
- package/.yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip +0 -0
- package/.yarn/cache/unique-slug-npm-4.0.0-e6b08f28aa-0884b58365.zip +0 -0
- package/.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip +0 -0
- package/.yarn/cache/vite-npm-3.2.3-34712b84f7-3c7c618f7f.zip +0 -0
- package/.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip +0 -0
- package/.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip +0 -0
- package/.yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-a790b846fd.zip +0 -0
- package/.yarn/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-371733296d.zip +0 -0
- package/.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip +0 -0
- package/.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/lib/adaptor.d.ts +2 -0
- package/lib/adaptor.js +2 -0
- package/lib/browser-test.d.ts +7 -2
- package/lib/browser-test.js +9 -3
- package/lib/expect/assert.d.ts +1 -0
- package/lib/expect/assert.js +11 -0
- package/package.json +2 -3
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/lib/adaptor.d.ts
ADDED
package/lib/adaptor.js
ADDED
package/lib/browser-test.d.ts
CHANGED
@@ -1,15 +1,18 @@
|
|
1
1
|
import { Spy } from "./spy";
|
2
2
|
declare type Option = {
|
3
|
-
html
|
3
|
+
html?: string;
|
4
|
+
url?: string;
|
4
5
|
width?: number;
|
5
6
|
height?: number;
|
6
7
|
};
|
7
8
|
declare type Result = {
|
8
9
|
description: string;
|
9
10
|
result: boolean;
|
11
|
+
error?: unknown;
|
10
12
|
};
|
11
13
|
export declare class BrowserTester {
|
12
14
|
private html;
|
15
|
+
private url;
|
13
16
|
private width?;
|
14
17
|
private height?;
|
15
18
|
private iframe;
|
@@ -17,7 +20,7 @@ export declare class BrowserTester {
|
|
17
20
|
private expects;
|
18
21
|
private beforeEachCallbacks;
|
19
22
|
private afterEachCallbacks;
|
20
|
-
constructor({ html, width, height, }: Option);
|
23
|
+
constructor({ html, url, width, height, }: Option);
|
21
24
|
spyOn<T extends string>(obj: Record<T, Function>, key: T): Spy<T>;
|
22
25
|
setBrowserSize(width: number, height: number): void;
|
23
26
|
beforeEach(callback: (window: Window, doc: Document) => Promise<void>): void;
|
@@ -41,6 +44,7 @@ export declare class BrowserTester {
|
|
41
44
|
toBeInstanceOf: (...value: unknown[]) => void;
|
42
45
|
toHaveBeenCalled: (...value: unknown[]) => void;
|
43
46
|
toHaveBeenCalledWith: (...value: unknown[]) => void;
|
47
|
+
toThrow: (...value: unknown[]) => void;
|
44
48
|
} & {
|
45
49
|
not: {
|
46
50
|
toBe: (...value: unknown[]) => void;
|
@@ -59,6 +63,7 @@ export declare class BrowserTester {
|
|
59
63
|
toBeInstanceOf: (...value: unknown[]) => void;
|
60
64
|
toHaveBeenCalled: (...value: unknown[]) => void;
|
61
65
|
toHaveBeenCalledWith: (...value: unknown[]) => void;
|
66
|
+
toThrow: (...value: unknown[]) => void;
|
62
67
|
};
|
63
68
|
};
|
64
69
|
clearTests(): void;
|
package/lib/browser-test.js
CHANGED
@@ -5,6 +5,7 @@ const expect_1 = require("./expect");
|
|
5
5
|
const spy_1 = require("./spy");
|
6
6
|
class BrowserTester {
|
7
7
|
html = '';
|
8
|
+
url = '';
|
8
9
|
width;
|
9
10
|
height;
|
10
11
|
iframe;
|
@@ -12,8 +13,9 @@ class BrowserTester {
|
|
12
13
|
expects = new expect_1.Expect();
|
13
14
|
beforeEachCallbacks = [];
|
14
15
|
afterEachCallbacks = [];
|
15
|
-
constructor({ html = '', width, height, }) {
|
16
|
+
constructor({ html = '', url = '', width, height, }) {
|
16
17
|
this.html = html;
|
18
|
+
this.url = url;
|
17
19
|
if (width) {
|
18
20
|
this.width = width;
|
19
21
|
}
|
@@ -63,8 +65,11 @@ class BrowserTester {
|
|
63
65
|
}
|
64
66
|
run() {
|
65
67
|
return new Promise((resolve) => {
|
66
|
-
|
67
|
-
|
68
|
+
let url = this.url;
|
69
|
+
if (!url) {
|
70
|
+
const blob = new Blob([this.html], { type: "text/html" });
|
71
|
+
url = URL.createObjectURL(blob);
|
72
|
+
}
|
68
73
|
const iframe = document.createElement('iframe');
|
69
74
|
const body = document.querySelector('body');
|
70
75
|
this.iframe = iframe;
|
@@ -93,6 +98,7 @@ class BrowserTester {
|
|
93
98
|
results.push({
|
94
99
|
description,
|
95
100
|
result: false,
|
101
|
+
error: e,
|
96
102
|
});
|
97
103
|
}
|
98
104
|
this.expects.clean();
|
package/lib/expect/assert.d.ts
CHANGED
package/lib/expect/assert.js
CHANGED
@@ -90,6 +90,17 @@ const assert = (expected) => ({
|
|
90
90
|
return expected.calledArgs.some(arg => {
|
91
91
|
return arg.every((a, i) => a === args[i]);
|
92
92
|
});
|
93
|
+
},
|
94
|
+
toThrow: () => {
|
95
|
+
try {
|
96
|
+
if (typeof expected === 'function') {
|
97
|
+
expected();
|
98
|
+
}
|
99
|
+
}
|
100
|
+
catch (e) {
|
101
|
+
return true;
|
102
|
+
}
|
103
|
+
return false;
|
93
104
|
}
|
94
105
|
});
|
95
106
|
exports.assert = assert;
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "html-browser-tester",
|
3
3
|
"main": "./lib/browser-test.js",
|
4
4
|
"types": "./lib/browser-test.d.ts",
|
5
|
-
"version": "0.0.
|
5
|
+
"version": "0.0.16",
|
6
6
|
"scripts": {
|
7
7
|
"dev": "vite",
|
8
8
|
"preview": "vite preview",
|
@@ -16,6 +16,5 @@
|
|
16
16
|
"devDependencies": {
|
17
17
|
"typescript": "^4.6.4",
|
18
18
|
"vite": "^3.2.3"
|
19
|
-
}
|
20
|
-
"dependencies": {}
|
19
|
+
}
|
21
20
|
}
|