@hedia/test 2.0.2 → 2.1.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/README.md +70 -5
- package/dist/src/fetchMocker.d.ts +28 -0
- package/dist/src/fetchMocker.js +77 -0
- package/dist/src/fetchMocker.js.map +1 -0
- package/dist/src/reporters/sonarcloud.js +1 -2
- package/dist/src/reporters/sonarcloud.js.map +1 -1
- package/dist/src/reporters/test.js.map +1 -1
- package/dist/test/fetchMocker.test.d.ts +1 -0
- package/dist/test/fetchMocker.test.js +264 -0
- package/dist/test/fetchMocker.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +53 -53
- package/src/fetchMocker.ts +106 -0
- package/src/reporters/sonarcloud.ts +2 -3
package/README.md
CHANGED
|
@@ -1,10 +1,75 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Test
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Tools for testing and reporting.
|
|
4
|
+
|
|
5
|
+
This package should always be installed as a development dependency wherever it is used.
|
|
6
|
+
|
|
7
|
+
## Utilities
|
|
8
|
+
|
|
9
|
+
### FetchMocker
|
|
10
|
+
|
|
11
|
+
FetchMocker is a class that helps to mock fetch requests in tests.
|
|
12
|
+
|
|
13
|
+
After creating an instance of FetchMocker, you can add any number of resources that it should intercept using the `addMock` method.
|
|
14
|
+
If a fetch request is made to a resource that has been added to the FetchMocker, the fetch request will be intercepted and the fetch implementation provided in the mock will be used instead.
|
|
15
|
+
If a fetch request is made to a resource that has not been added to the FetchMocker, the fetch request will be passed through to the real fetch implementation.
|
|
16
|
+
|
|
17
|
+
FetchMocker's constructor accepts two optional arguments:
|
|
18
|
+
|
|
19
|
+
1. _testContext_:
|
|
20
|
+
If a test context is provided, the FetchMocker will automatically remove all mocks after the test has run.
|
|
21
|
+
See the example below.
|
|
22
|
+
This is useful for ensuring that mocks do not interfere with other tests.
|
|
23
|
+
If a test context is not provided, the mocks will not be removed automatically, and you will need to remove the mocks manually.
|
|
24
|
+
2. _verbose_:
|
|
25
|
+
If `verbose` is set to `true`, the mock will log information about the fetch requests it intercepts and the fetch requests it passes through to the real fetch implementation.
|
|
26
|
+
This can be useful when first setting up a test to see which fetch requests are being made and which are being intercepted.
|
|
27
|
+
Verbose mode should generally be turned off in the final test, as it can make the test output difficult to read.
|
|
28
|
+
|
|
29
|
+
The `addMock` method takes an object with the following properties:
|
|
30
|
+
|
|
31
|
+
- _resource_ is the url of the request you want to mock. It can be a string, a URL, or a regular expression.
|
|
32
|
+
If a string or a URL is provided, the mock will match the url exactly with the resource except for any search query parameters.
|
|
33
|
+
Search query parameters will be parsed so their order does not matter.
|
|
34
|
+
Furthermore, all search query parameters given in the resource specification will be required but any extra query parameters used in the fetch call will be ignored. See example below.
|
|
35
|
+
If a regular expression is provided, the mock will match the url with the resource using the regular expression.
|
|
36
|
+
- _fetchImplementation_ is a function that will be called when a fetch request is made to the resource.
|
|
37
|
+
- _method_ is an optional property that specifies the method of the request you want to mock. If it is not provided, the mock will match any method.
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
it("should fetch data", async (testContext) => {
|
|
41
|
+
// When passing a TestContext to the FetchMocker constructor, the mock will be automatically removed after the test.
|
|
42
|
+
const fetchMocker = new FetchMocker(testContext)
|
|
43
|
+
.addMock({
|
|
44
|
+
resource: "https://api.example.com/data?param1=value1¶m2=value2",
|
|
45
|
+
fetchImplementation: () => Response(JSON.stringify({ data: "test" })),
|
|
46
|
+
})
|
|
47
|
+
.addMock({
|
|
48
|
+
resource: "https://api.example.com/data",
|
|
49
|
+
method: "POST", // Optional. By default any method will be matched.
|
|
50
|
+
fetchImplementation: () => Response(JSON.stringify({ error: "not allowed" }), { status: 403 }),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Note that the order of search query parameters does not matter.
|
|
54
|
+
// Furthermore, extra query parameters will be ignored.
|
|
55
|
+
const response = await fetch("https://api.example.com/data?param2=value2¶m1=value1¶m3=value3");
|
|
56
|
+
await fetch("https://api.example.com/data", { method: "POST" });
|
|
57
|
+
|
|
58
|
+
// The underlying mock object can be accessed to make assertions about the calls to fetch.
|
|
59
|
+
assert.equal(fetchMocker.mockedFetch.mock.calls, 2);
|
|
60
|
+
|
|
61
|
+
// FetchMocker keeps track of which mocks have been used, so we can check if all mocks have been used.
|
|
62
|
+
assert(fetchMocker.allMocksUsed());
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Custom Test Reporters
|
|
67
|
+
|
|
68
|
+
### Test Reporter
|
|
4
69
|
|
|
5
70
|
Format and send test output to the `test-service`.
|
|
6
71
|
|
|
7
|
-
|
|
72
|
+
### Usage
|
|
8
73
|
|
|
9
74
|
```
|
|
10
75
|
node --test --experimental-test-coverage --test-reporter @hedia/test/reporters/test
|
|
@@ -12,11 +77,11 @@ node --test --experimental-test-coverage --test-reporter @hedia/test/reporters/t
|
|
|
12
77
|
|
|
13
78
|
Tip: Save the following command as a script in `package.json`
|
|
14
79
|
|
|
15
|
-
|
|
80
|
+
### Sonarcloud Reporter
|
|
16
81
|
|
|
17
82
|
Extracts coverage information from tests and creates generic coverage.xml file.
|
|
18
83
|
|
|
19
|
-
|
|
84
|
+
### Usage
|
|
20
85
|
|
|
21
86
|
```
|
|
22
87
|
node --test --experimental-test-coverage --test-reporter @hedia/test/reporters/sonarcloud
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
+
import { Mock } from "node:test";
|
|
5
|
+
interface TestContext {
|
|
6
|
+
mock: {
|
|
7
|
+
method: (objectToMock: object, methodToMock: string, implementation: typeof fetch) => Mock<typeof fetch>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface FetchMock {
|
|
11
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
12
|
+
resource: string | URL | RegExp;
|
|
13
|
+
fetchImplementation: typeof fetch;
|
|
14
|
+
}
|
|
15
|
+
interface UsedIndicator {
|
|
16
|
+
used: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class FetchMocker {
|
|
19
|
+
private readonly originalFetch;
|
|
20
|
+
mockedFetch: Mock<typeof fetch>;
|
|
21
|
+
mocks: (FetchMock & UsedIndicator)[];
|
|
22
|
+
verbose: boolean;
|
|
23
|
+
constructor(testContext?: TestContext, verbose?: boolean);
|
|
24
|
+
addMock(mock: FetchMock): this;
|
|
25
|
+
customFetch(resource: string | URL | Request, options?: RequestInit): Promise<Response>;
|
|
26
|
+
allMocksUsed(): boolean;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { mock } from "node:test";
|
|
2
|
+
export class FetchMocker {
|
|
3
|
+
originalFetch;
|
|
4
|
+
mockedFetch;
|
|
5
|
+
mocks = [];
|
|
6
|
+
verbose;
|
|
7
|
+
constructor(testContext, verbose = false) {
|
|
8
|
+
this.originalFetch = fetch;
|
|
9
|
+
if (testContext) {
|
|
10
|
+
this.mockedFetch = testContext.mock.method(global, "fetch", this.customFetch.bind(this));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.mockedFetch = mock.method(global, "fetch", this.customFetch.bind(this));
|
|
14
|
+
}
|
|
15
|
+
this.verbose = verbose;
|
|
16
|
+
}
|
|
17
|
+
addMock(mock) {
|
|
18
|
+
this.mocks.push({ ...mock, used: false });
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
async customFetch(resource, options) {
|
|
22
|
+
const requestMethod = options?.method ?? "GET";
|
|
23
|
+
const requestedUrl = new URL(resource instanceof Request ? resource.url : resource);
|
|
24
|
+
for (const mock of this.mocks) {
|
|
25
|
+
if (mock.method && mock.method != requestMethod) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (mock.resource instanceof RegExp) {
|
|
29
|
+
if (!mock.resource.test(requestedUrl.toString())) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const mockedUrl = new URL(mock.resource);
|
|
35
|
+
const searchParamsMatch = Array.from(mockedUrl.searchParams).every(([key, value]) => requestedUrl.searchParams.has(key) && requestedUrl.searchParams.get(key) == value);
|
|
36
|
+
if (requestedUrl.origin != mockedUrl.origin ||
|
|
37
|
+
requestedUrl.pathname != mockedUrl.pathname ||
|
|
38
|
+
!searchParamsMatch) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
console.log(`using mock to handle ${requestMethod ?? "GET"} ${requestedUrl.toString()}`);
|
|
44
|
+
}
|
|
45
|
+
mock.used = true;
|
|
46
|
+
return await mock.fetchImplementation(resource, options);
|
|
47
|
+
}
|
|
48
|
+
if (this.verbose) {
|
|
49
|
+
console.log(`using original fetch to handle ${requestMethod ?? "GET"} ${requestedUrl.toString()}`);
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
return await this.originalFetch(resource, options);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (options?.redirect !== "manual") {
|
|
56
|
+
console.warn(`WARNING: The original fetch function failed to ${requestMethod ?? "GET"} ${requestedUrl.toString()}. Did you ` +
|
|
57
|
+
"forget to mock a resource or to set redirect=manual? The following error occurred when calling the original fetch function from the " +
|
|
58
|
+
"mock. This could indicate that fetch tried to follow a redirect to something that is not " +
|
|
59
|
+
"available.");
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
allMocksUsed() {
|
|
65
|
+
const result = this.mocks.every((mock) => mock.used);
|
|
66
|
+
if (!result) {
|
|
67
|
+
console.warn("WARNING: Not all the defined mocks were used.");
|
|
68
|
+
for (const mock of this.mocks) {
|
|
69
|
+
if (!mock.used) {
|
|
70
|
+
console.warn(`- Mock for ${mock.resource.toString()} was not used.`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=fetchMocker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchMocker.js","sourceRoot":"","sources":["../../src/fetchMocker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAE,MAAM,WAAW,CAAC;AAkBvC,MAAM,OAAO,WAAW;IACN,aAAa,CAAe;IAC7C,WAAW,CAAqB;IAChC,KAAK,GAAkC,EAAE,CAAC;IAC1C,OAAO,CAAU;IAEjB,YAAY,WAAyB,EAAE,OAAO,GAAG,KAAK;QACrD,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,WAAW,EAAE,CAAC;YACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1F,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,IAAe;QACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;IACb,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAgC,EAAE,OAAqB;QACxE,MAAM,aAAa,GAAW,OAAO,EAAE,MAAM,IAAI,KAAK,CAAC;QACvD,MAAM,YAAY,GAAG,IAAI,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
-
// @ts-ignore
|
|
21
20
|
const entry = sourceMap?.findOrigin(line.line, 1);
|
|
22
21
|
if (entry) {
|
|
23
22
|
originalFiles[entry.fileName] = originalFiles[entry.fileName] || new Map();
|
|
24
23
|
const originalFile = originalFiles[entry.fileName];
|
|
25
|
-
const count = (originalFile.get(entry.lineNumber)
|
|
24
|
+
const count = (originalFile.get(entry.lineNumber) ?? 0) + line.count;
|
|
26
25
|
originalFile.set(entry.lineNumber, count);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonarcloud.js","sourceRoot":"","sources":["../../../src/reporters/sonarcloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAe,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA8BpD,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,kBAAkB,CAAC,MAAuB;IACxE,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"sonarcloud.js","sourceRoot":"","sources":["../../../src/reporters/sonarcloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAe,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA8BpD,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,kBAAkB,CAAC,MAAuB;IACxE,IAAI,KAAK,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AI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAEhH,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAc;IAC1C,OAAO,oDAAoD,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC;AACpG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/reporters/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AA8BlC,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAC,MAAuB;IAClE,IAAI;
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/reporters/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AA8BlC,MAAM,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAC,MAAuB;IAClE,IAAI,CAAC;QACJ,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,YAAY,GAAa,EAAE,CAAC;QAChC,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC;QAEtB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAClC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,YAAY;oBAChB,IAAI,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;wBACvC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBACnC,YAAY,IAAI,CAAC,CAAC;oBACnB,CAAC;oBACD,IAAI,YAAY,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;wBACzC,YAAY,CAAC,YAA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@@ -0,0 +1,264 @@
|
|
|
1
|
+
import assert from "node:assert";
|
|
2
|
+
import { createServer } from "node:http";
|
|
3
|
+
import { after, before, describe, it, mock } from "node:test";
|
|
4
|
+
import { FetchMocker } from "../src/fetchMocker.js";
|
|
5
|
+
describe("FetchMocker", () => {
|
|
6
|
+
let server;
|
|
7
|
+
before(() => {
|
|
8
|
+
server = createServer((req, res) => {
|
|
9
|
+
res.writeHead(418, { "Content-Type": "application/json" });
|
|
10
|
+
res.end("I'm a teapot");
|
|
11
|
+
});
|
|
12
|
+
server.listen(8080);
|
|
13
|
+
});
|
|
14
|
+
after(() => {
|
|
15
|
+
server.close();
|
|
16
|
+
});
|
|
17
|
+
it("can selectively mock multiple fetch calls", async (testContext) => {
|
|
18
|
+
new FetchMocker(testContext)
|
|
19
|
+
.addMock({
|
|
20
|
+
resource: "https://www.example.com",
|
|
21
|
+
fetchImplementation: async () => new Response("Hello, world!", { status: 200 }),
|
|
22
|
+
})
|
|
23
|
+
.addMock({
|
|
24
|
+
resource: "http://localhost:8080/makeshift",
|
|
25
|
+
fetchImplementation: async () => new Response("Hello, there!", { status: 200 }),
|
|
26
|
+
});
|
|
27
|
+
const response1 = await fetch("https://www.example.com");
|
|
28
|
+
assert(response1.ok);
|
|
29
|
+
assert.equal(response1.status, 200);
|
|
30
|
+
assert.equal(await response1.text(), "Hello, world!");
|
|
31
|
+
const response2 = await fetch("http://localhost:8080/makeshift");
|
|
32
|
+
assert(response2.ok);
|
|
33
|
+
assert.equal(response2.status, 200);
|
|
34
|
+
assert.equal(await response2.text(), "Hello, there!");
|
|
35
|
+
const response3 = await fetch("http://localhost:8080/");
|
|
36
|
+
assert(!response3.ok);
|
|
37
|
+
assert.equal(response3.status, 418);
|
|
38
|
+
assert.equal(await response3.text(), "I'm a teapot");
|
|
39
|
+
});
|
|
40
|
+
it("only mocks fetch calls within the given test context", async () => {
|
|
41
|
+
// Fetch calls in this test should not be mocked by the FetchMocker defined in the previous test
|
|
42
|
+
const response = await fetch("http://localhost:8080/makeshift");
|
|
43
|
+
assert(!response.ok);
|
|
44
|
+
assert.equal(response.status, 418);
|
|
45
|
+
assert.equal(await response.text(), "I'm a teapot");
|
|
46
|
+
});
|
|
47
|
+
it("prints a warning when the original fetch throws an exception", async (testContext) => {
|
|
48
|
+
const consoleWarnMock = testContext.mock.method(console, "warn", () => { });
|
|
49
|
+
new FetchMocker(testContext);
|
|
50
|
+
await assert.rejects(async () => {
|
|
51
|
+
await fetch("http://localhost:8081/exception");
|
|
52
|
+
});
|
|
53
|
+
assert(consoleWarnMock.mock.calls.length == 1);
|
|
54
|
+
const warningMessage = consoleWarnMock.mock.calls[0].arguments[0];
|
|
55
|
+
assert(warningMessage.includes("GET http://localhost:8081/exception"));
|
|
56
|
+
assert(warningMessage.includes("redirect"));
|
|
57
|
+
assert(warningMessage.includes("manual"));
|
|
58
|
+
});
|
|
59
|
+
describe("http method specification", () => {
|
|
60
|
+
it("doesn't restrict the http method of a mock if unspecified", async (testContext) => {
|
|
61
|
+
new FetchMocker(testContext).addMock({
|
|
62
|
+
resource: "http://localhost:8080/something",
|
|
63
|
+
fetchImplementation: async () => new Response("Hello, world!", { status: 200 }),
|
|
64
|
+
});
|
|
65
|
+
for (const method of [null, "GET", "POST", "PUT", "DELETE"]) {
|
|
66
|
+
const initArgument = method ? { method } : undefined;
|
|
67
|
+
const response = await fetch("http://localhost:8080/something", initArgument);
|
|
68
|
+
assert(response.ok);
|
|
69
|
+
assert.equal(response.status, 200);
|
|
70
|
+
assert.equal(await response.text(), "Hello, world!");
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
it("restricts the http method of a mock if specified", async (testContext) => {
|
|
74
|
+
new FetchMocker(testContext).addMock({
|
|
75
|
+
resource: "http://localhost:8080/something",
|
|
76
|
+
method: "POST",
|
|
77
|
+
fetchImplementation: async () => new Response("Hello, post!", { status: 201 }),
|
|
78
|
+
});
|
|
79
|
+
const response = await fetch("http://localhost:8080/something", { method: "POST" });
|
|
80
|
+
assert(response.ok);
|
|
81
|
+
assert.equal(response.status, 201);
|
|
82
|
+
assert.equal(await response.text(), "Hello, post!");
|
|
83
|
+
for (const method of [null, "GET", "PUT", "DELETE"]) {
|
|
84
|
+
const initArgument = method ? { method } : undefined;
|
|
85
|
+
const response = await fetch("http://localhost:8080/something", initArgument);
|
|
86
|
+
assert(!response.ok);
|
|
87
|
+
assert.equal(response.status, 418);
|
|
88
|
+
assert.equal(await response.text(), "I'm a teapot");
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe("resource url matching", () => {
|
|
93
|
+
it("only matches a string resource url exactly", async (testContext) => {
|
|
94
|
+
new FetchMocker(testContext).addMock({
|
|
95
|
+
resource: "http://localhost:8080/words",
|
|
96
|
+
fetchImplementation: async () => new Response("Hello, purple!", { status: 200 }),
|
|
97
|
+
});
|
|
98
|
+
const response1 = await fetch("http://localhost:8080/words");
|
|
99
|
+
assert(response1.ok);
|
|
100
|
+
assert.equal(response1.status, 200);
|
|
101
|
+
assert.equal(await response1.text(), "Hello, purple!");
|
|
102
|
+
const response2 = await fetch("http://localhost:8080/word");
|
|
103
|
+
assert(!response2.ok);
|
|
104
|
+
assert.equal(response2.status, 418);
|
|
105
|
+
assert.equal(await response2.text(), "I'm a teapot");
|
|
106
|
+
const response3 = await fetch("http://localhost:8080/wordsmith");
|
|
107
|
+
assert(!response3.ok);
|
|
108
|
+
assert.equal(response3.status, 418);
|
|
109
|
+
assert.equal(await response3.text(), "I'm a teapot");
|
|
110
|
+
});
|
|
111
|
+
it("matches RegExp resource url", async (testContext) => {
|
|
112
|
+
new FetchMocker(testContext).addMock({
|
|
113
|
+
resource: /local(host|teapot):\d{4}\/[a-z]{5}$/,
|
|
114
|
+
fetchImplementation: async () => new Response("Hello, RegExp!", { status: 200 }),
|
|
115
|
+
});
|
|
116
|
+
for (const url of [
|
|
117
|
+
"http://localhost:8080/words",
|
|
118
|
+
"http://localhost:1234/house",
|
|
119
|
+
"localteapot:0123/sword",
|
|
120
|
+
]) {
|
|
121
|
+
const response = await fetch(url);
|
|
122
|
+
assert(response.ok, `response not ok for ${url}`);
|
|
123
|
+
assert.equal(response.status, 200, `status not 200 for ${url}`);
|
|
124
|
+
assert.equal(await response.text(), "Hello, RegExp!", `text not correct for ${url}`);
|
|
125
|
+
}
|
|
126
|
+
for (const url of [
|
|
127
|
+
"http://localhost:8080/word",
|
|
128
|
+
"http://localhost:8080/12345",
|
|
129
|
+
new Request("http://localhost:8080/wordsmith"),
|
|
130
|
+
]) {
|
|
131
|
+
const response = await fetch(url);
|
|
132
|
+
assert(!response.ok);
|
|
133
|
+
assert.equal(response.status, 418);
|
|
134
|
+
assert.equal(await response.text(), "I'm a teapot");
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
it("matches URL resource", async (testContext) => {
|
|
138
|
+
new FetchMocker(testContext).addMock({
|
|
139
|
+
resource: new URL("http://localhost:8080/words"),
|
|
140
|
+
fetchImplementation: async () => new Response("Hello, URL!", { status: 200 }),
|
|
141
|
+
});
|
|
142
|
+
const response1 = await fetch("http://localhost:8080/words");
|
|
143
|
+
assert(response1.ok);
|
|
144
|
+
assert.equal(response1.status, 200);
|
|
145
|
+
assert.equal(await response1.text(), "Hello, URL!");
|
|
146
|
+
const response2 = await fetch("http://localhost:8080/word");
|
|
147
|
+
assert(!response2.ok);
|
|
148
|
+
assert.equal(response2.status, 418);
|
|
149
|
+
assert.equal(await response2.text(), "I'm a teapot");
|
|
150
|
+
const response3 = await fetch(new Request("http://localhost:8080/wordsmith"));
|
|
151
|
+
assert(!response3.ok);
|
|
152
|
+
assert.equal(response3.status, 418);
|
|
153
|
+
assert.equal(await response3.text(), "I'm a teapot");
|
|
154
|
+
});
|
|
155
|
+
describe("query arguments", () => {
|
|
156
|
+
before(() => {
|
|
157
|
+
new FetchMocker().addMock({
|
|
158
|
+
resource: new URL("http://localhost:8080/words?color=purple&number=5"),
|
|
159
|
+
fetchImplementation: async () => new Response("Hello, purple!", { status: 200 }),
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
after(() => {
|
|
163
|
+
mock.reset();
|
|
164
|
+
});
|
|
165
|
+
it("matches if all the query arguments are in the same order", async () => {
|
|
166
|
+
const response1 = await fetch("http://localhost:8080/words?color=purple&number=5");
|
|
167
|
+
assert(response1.ok);
|
|
168
|
+
assert.equal(response1.status, 200);
|
|
169
|
+
assert.equal(await response1.text(), "Hello, purple!");
|
|
170
|
+
});
|
|
171
|
+
it("matches if the query arguments are in a different order", async () => {
|
|
172
|
+
const response2 = await fetch("http://localhost:8080/words?number=5&color=purple");
|
|
173
|
+
assert(response2.ok);
|
|
174
|
+
assert.equal(response2.status, 200);
|
|
175
|
+
assert.equal(await response2.text(), "Hello, purple!");
|
|
176
|
+
});
|
|
177
|
+
it("doesn't match if a given query argument has a wrong value", async () => {
|
|
178
|
+
const response3 = await fetch("http://localhost:8080/words?color=blue&number=5");
|
|
179
|
+
assert(!response3.ok);
|
|
180
|
+
assert.equal(response3.status, 418);
|
|
181
|
+
assert.equal(await response3.text(), "I'm a teapot");
|
|
182
|
+
});
|
|
183
|
+
it("doesn't match if a given query argument is missing", async () => {
|
|
184
|
+
const response4 = await fetch("http://localhost:8080/words?number=5");
|
|
185
|
+
assert(!response4.ok);
|
|
186
|
+
assert.equal(response4.status, 418);
|
|
187
|
+
assert.equal(await response4.text(), "I'm a teapot");
|
|
188
|
+
});
|
|
189
|
+
it("matches if extra query arguments are present", async () => {
|
|
190
|
+
const response5 = await fetch("http://localhost:8080/words?color=purple&number=5&extra=stuff");
|
|
191
|
+
assert(response5.ok);
|
|
192
|
+
assert.equal(response5.status, 200);
|
|
193
|
+
assert.equal(await response5.text(), "Hello, purple!");
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe("verbose mode", () => {
|
|
198
|
+
it("can be turned on", async (testContext) => {
|
|
199
|
+
const consoleLogMock = testContext.mock.method(console, "log", () => { });
|
|
200
|
+
new FetchMocker(testContext, true).addMock({
|
|
201
|
+
resource: "http://localhost:8080/verbose",
|
|
202
|
+
fetchImplementation: async () => new Response("Hello, verbose!", { status: 200 }),
|
|
203
|
+
});
|
|
204
|
+
await fetch("http://localhost:8080/verbose");
|
|
205
|
+
await fetch("http://localhost:8080/other");
|
|
206
|
+
assert.equal(consoleLogMock.mock.calls[0].arguments[0], "using mock to handle GET http://localhost:8080/verbose");
|
|
207
|
+
assert.equal(consoleLogMock.mock.calls[1].arguments[0], "using original fetch to handle GET http://localhost:8080/other");
|
|
208
|
+
});
|
|
209
|
+
it("is off by default", async (testContext) => {
|
|
210
|
+
const consoleLogMock = testContext.mock.method(console, "log", () => { });
|
|
211
|
+
new FetchMocker(testContext).addMock({
|
|
212
|
+
resource: "http://localhost:8080/nonverbose",
|
|
213
|
+
fetchImplementation: async () => new Response("Hello, normal!", { status: 200 }),
|
|
214
|
+
});
|
|
215
|
+
await fetch("http://localhost:8080/verbose");
|
|
216
|
+
await fetch("http://localhost:8080/other");
|
|
217
|
+
assert.equal(consoleLogMock.mock.calls.length, 0);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
describe("exhaustiveness check", () => {
|
|
221
|
+
it("can warn about unused mocks", async (testContext) => {
|
|
222
|
+
const consoleWarnMock = testContext.mock.method(console, "warn", () => { });
|
|
223
|
+
const fetchMocker = new FetchMocker(testContext)
|
|
224
|
+
.addMock({
|
|
225
|
+
resource: "http://localhost:8083/used",
|
|
226
|
+
fetchImplementation: async () => new Response("Hello, first!", { status: 200 }),
|
|
227
|
+
})
|
|
228
|
+
.addMock({
|
|
229
|
+
resource: "http://localhost:8081/string",
|
|
230
|
+
fetchImplementation: async () => new Response("Hello, string!", { status: 200 }),
|
|
231
|
+
})
|
|
232
|
+
.addMock({
|
|
233
|
+
resource: /localhost:\d{4}\/regexp/,
|
|
234
|
+
fetchImplementation: async () => new Response("Hello, RegExp!", { status: 200 }),
|
|
235
|
+
})
|
|
236
|
+
.addMock({
|
|
237
|
+
resource: new URL("http://localhost:8082/url"),
|
|
238
|
+
fetchImplementation: async () => new Response("Hello, URL!", { status: 200 }),
|
|
239
|
+
});
|
|
240
|
+
await fetch("http://localhost:8083/used");
|
|
241
|
+
fetchMocker.allMocksUsed();
|
|
242
|
+
assert.equal(consoleWarnMock.mock.calls[0].arguments[0], "WARNING: Not all the defined mocks were used.");
|
|
243
|
+
assert.equal(consoleWarnMock.mock.calls[1].arguments[0], "- Mock for http://localhost:8081/string was not used.");
|
|
244
|
+
assert.equal(consoleWarnMock.mock.calls[2].arguments[0], "- Mock for /localhost:\\d{4}\\/regexp/ was not used.");
|
|
245
|
+
assert.equal(consoleWarnMock.mock.calls[3].arguments[0], "- Mock for http://localhost:8082/url was not used.");
|
|
246
|
+
assert.equal(consoleWarnMock.mock.calls.length, 4); // ensure no warning about the used mock
|
|
247
|
+
});
|
|
248
|
+
it("returns true if all mocks were used", async (testContext) => {
|
|
249
|
+
const fetchMocker = new FetchMocker(testContext)
|
|
250
|
+
.addMock({
|
|
251
|
+
resource: "http://localhost:8083/first",
|
|
252
|
+
fetchImplementation: async () => new Response("Hello, first!", { status: 200 }),
|
|
253
|
+
})
|
|
254
|
+
.addMock({
|
|
255
|
+
resource: "http://localhost:8083/second",
|
|
256
|
+
fetchImplementation: async () => new Response("Hello, second!", { status: 200 }),
|
|
257
|
+
});
|
|
258
|
+
await fetch("http://localhost:8083/first");
|
|
259
|
+
await fetch("http://localhost:8083/second");
|
|
260
|
+
assert(fetchMocker.allMocksUsed());
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
//# sourceMappingURL=fetchMocker.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchMocker.test.js","sourceRoot":"","sources":["../../test/fetchMocker.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAU,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,KA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modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2022.full.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@hedia/html/dist/src/index.d.ts","../src/reporters/sonarcloud.ts","../src/reporters/test.ts","../test/index.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true,"impliedFormat":1},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true,"impliedFormat":1},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true,"impliedFormat":1},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true,"impliedFormat":1},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true,"impliedFormat":1},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true,"impliedFormat":1},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true,"impliedFormat":1},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true,"impliedFormat":1},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true,"impliedFormat":1},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true,"impliedFormat":1},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true,"impliedFormat":1},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true,"impliedFormat":1},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true,"impliedFormat":1},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc496ef4377553e461efcf7cc5a5a57cf59f9962aea06b5e722d54a36bf66ea1","affectsGlobalScope":true,"impliedFormat":1},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true,"impliedFormat":1},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true,"impliedFormat":1},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true,"impliedFormat":1},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1df2366de6650547b3dc1d7c4147355c0f6b4729c964e3839636fa418982d131","impliedFormat":1},{"version":"09df3b4f1c937f02e7fee2836d4c4d7a63e66db70fd4d4e97126f4542cc21d9d","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"ec88296eb354d6d6c416719c698176b83b95b8c4ba2da7807bcd239de131a9eb","impliedFormat":1},{"version":"65f3c6a0c09c37b9c60b1bebba0f46109ddb276daae9a69a701efc2c33625e3b","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"9cac839d40a54367bdb6921e5f2d769ac628054469555df9666ed301c358d401","impliedFormat":1},{"version":"15ac637ce75120bde1573cc15c85119f82b85dc36087c937df26503d993eba1b","impliedFormat":1},{"version":"e16e9732868a418d009a4ffb7ace7729f95a48b03a2af76c9b3f44f658f9bc31","impliedFormat":1},{"version":"383b91398f3ad5520d74661409ed1026e553a7ebc607028a8435385ddc8aa0e6","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"eaa2e9af2d32f0586ef50ff5621d3ff94d1e0033639d6b8c84b687bbefbf065f","impliedFormat":1},{"version":"2dc0e70d668c368263d9516c60f9e3cb153ad5f5fe327c90ca7d8d29e56fe5e6","impliedFormat":1},{"version":"8005645fc744dad7d35a19d96ecf6a797b038fd0c9bd92a474ac5708161feef8","impliedFormat":1},{"version":"5eb53680a375d61c26cbf455ad18a2e27c738bd576e6acf973b3b30f0a743b7b","impliedFormat":1},{"version":"bd8d46dc9e5cfff76b40e8b418ef1e55848366c0ded87cdc06b5a43a9f5e9199","impliedFormat":1},{"version":"c04bcdbaa363ef77f872d480e49e0ba998308e6a30e9f92542dd551002c7c6ac","impliedFormat":1},{"version":"3a5edc4c3a85102031e36f88ac0149a3c1599c3acabd3a8d62abdc767c96d468","impliedFormat":1},{"version":"5fa0dc3c25e77dc8488194dde96c862fb6df566c6bfc747b4dc8328c8551dc4a","impliedFormat":1},{"version":"e00f958278e17b33bea65dc9954e67b8cab7c47894fbf04afd7465e56283ddb8","impliedFormat":1},{"version":"926b74b0bfae3c43ea8cb9110f4036bbb48c6937593a82a2a29af0d7b027a292","impliedFormat":1},{"version":"14b85ecbd754259898ac8e5a947b66435dbe8325be58f35414dc34680f882e75","impliedFormat":1},{"version":"a26b1facfea6b62ce9ec55106d84fefd1300bdda27ba5ee2bd5ebb676135f644","impliedFormat":1},{"version":"55245877be1a89483a0e3dc347a17652c034f44b10c3018a62ac8766b7401918","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"95f7af90a4415d19e1669570d2525b99f8faed7fd9e14f7a29b43dec6d24c74b","impliedFormat":1},{"version":"cd5b6b99ab7f077ea544a9273a8a6de485105ea5bbd8b17fd8eed51911f5b345","impliedFormat":1},{"version":"003dd4da4880a8ad4b9bf4b0dcc217cdf7dfc4c4907d1d236a71189d3e56fe0c","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"88f9f1cfe56e8e4102031351e9a475378348e65b1515f530fc0fa8e661363f07","impliedFormat":1},{"version":"22b3448d5719ff776dec09473d2dbebe46b6d33b8ecd621c128fbde822f44aae","impliedFormat":1},{"version":"fe4b1355abf0937908ef8fa825b656d06d9924d18bddec40eee3a6d42cc73385","impliedFormat":1},{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true,"impliedFormat":1},{"version":"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c","impliedFormat":1},{"version":"5a856afb15f9dc9983faa391dde989826995a33983c1cccb173e9606688e9709","affectsGlobalScope":true,"impliedFormat":1},{"version":"546ab07e19116d935ad982e76a223275b53bff7771dab94f433b7ab04652936e","impliedFormat":1},{"version":"7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba","impliedFormat":1},{"version":"aefb5a4a209f756b580eb53ea771cca8aad411603926f307a5e5b8ec6b16dcf6","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"f5a8b7ec4b798c88679194a8ebc25dcb6f5368e6e5811fcda9fe12b0d445b8db","impliedFormat":1},{"version":"b86e1a45b29437f3a99bad4147cb9fe2357617e8008c0484568e5bb5138d6e13","impliedFormat":1},{"version":"b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","impliedFormat":1},{"version":"42c431e7965b641106b5e25ab3283aa4865ca7bb9909610a2abfa6226e4348be","impliedFormat":1},{"version":"0b7e732af0a9599be28c091d6bd1cb22c856ec0d415d4749c087c3881ca07a56","impliedFormat":1},{"version":"b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e","impliedFormat":1},{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d6138a264ddc6f94f16e99d4e117a2d6eb31b217891cf091b6437a2f114d561","affectsGlobalScope":true,"impliedFormat":1},{"version":"3b4c85eea12187de9929a76792b98406e8778ce575caca8c574f06da82622c54","impliedFormat":1},{"version":"f788131a39c81e0c9b9e463645dd7132b5bc1beb609b0e31e5c1ceaea378b4df","impliedFormat":1},{"version":"0c236069ce7bded4f6774946e928e4b3601894d294054af47a553f7abcafe2c1","impliedFormat":1},{"version":"21894466693f64957b9bd4c80fa3ec7fdfd4efa9d1861e070aca23f10220c9b2","impliedFormat":1},{"version":"396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","impliedFormat":1},{"version":"21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac","impliedFormat":1},{"version":"6ec93c745c5e3e25e278fa35451bf18ef857f733de7e57c15e7920ac463baa2a","affectsGlobalScope":true,"impliedFormat":1},{"version":"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","impliedFormat":1},{"version":"30c2ec6abf6aaa60eb4f32fb1235531506b7961c6d1bdc7430711aec8fd85295","impliedFormat":1},{"version":"0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7","impliedFormat":1},{"version":"308b84e1943ef30015469770e931eb21b795348893b2a6562ca54ea8f0b3c41c","affectsGlobalScope":true,"impliedFormat":1},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true,"impliedFormat":1},{"version":"7aaeb5e62f90e1b2be0fc4844df78cdb1be15c22b427bc6c39d57308785b8f10","impliedFormat":1},{"version":"3ba30205a029ebc0c91d7b1ab4da73f6277d730ca1fc6692d5a9144c6772c76b","impliedFormat":1},{"version":"d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","impliedFormat":1},{"version":"8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","impliedFormat":1},{"version":"01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","impliedFormat":1},{"version":"458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","impliedFormat":1},{"version":"269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","impliedFormat":1},{"version":"831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12","impliedFormat":1},{"version":"24ba151e213906027e2b1f5223d33575a3612b0234a0e2b56119520bbe0e594b","affectsGlobalScope":true,"impliedFormat":1},{"version":"cbf046714f3a3ba2544957e1973ac94aa819fa8aa668846fa8de47eb1c41b0b2","affectsGlobalScope":true,"impliedFormat":1},{"version":"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","impliedFormat":1},{"version":"eae74e3d50820f37c72c0679fed959cd1e63c98f6a146a55b8c4361582fa6a52","impliedFormat":1},{"version":"7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","impliedFormat":1},{"version":"7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df","impliedFormat":1},{"version":"aed89e3c18f4c659ee8153a76560dffda23e2d801e1e60d7a67abd84bc555f8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","impliedFormat":1},{"version":"2f940651c2f30e6b29f8743fae3f40b7b1c03615184f837132b56ea75edad08b","impliedFormat":1},{"version":"5749c327c3f789f658072f8340786966c8b05ea124a56c1d8d60e04649495a4d","impliedFormat":1},{"version":"c9d62b2a51b2ff166314d8be84f6881a7fcbccd37612442cf1c70d27d5352f50","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","impliedFormat":1},{"version":"ecb5fc64a0a35c0a74d0679a8ff8b34f734b91ee832d0ef3ab82c984c13b1396","impliedFormat":99},{"version":"4932fde895ca469d9894db8d43d46b9296e1e48c6a30ab9736dd3c5c0ab18b55","signature":"3183155522f224a465b0554392814122b1c25fba5839372989b2e87772d19dc0","impliedFormat":99},{"version":"f37931475107cf3e7afcb22277d45e785b8b56d4ad51652dea0926e5a841ff5c","signature":"85503e3410a7f50492cbd74c104329869eead5d6a4dc1139ed5a0ba448be8f83","impliedFormat":99},{"version":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":99},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"ae8d30ed0595a3041559e33223940bddc2e3d837dbaf0d746ae4170b49060898","impliedFormat":1},{"version":"f53cadc55ef76fe3a1f80ba99ab351ca3a7939c97249ae16811735ae13c94d0a","impliedFormat":1},{"version":"527110dbc0c9e571c3edfa80ed3d2dabac9250173c96c09cd1e3c816d8b335bc","impliedFormat":1},{"version":"34a1af0ddcfe615e9208b1a0befcc9ae0f700f660141df51aaed10a2744b9211","impliedFormat":1},{"version":"0350373838b4c178bf6c977da314949ef96fa81f2e4e470f214065c0fab4cb68","impliedFormat":1},{"version":"4ce7464792c28327b2aa33daa02814af00750713037fac75b403d0c8c683218a","impliedFormat":1},{"version":"f71d5d34f4bd45cae10c9970d32a9927be072b6c34961b367448b749cc83145d","impliedFormat":1},{"version":"cb34007552d5e04c45f1dabcb2c9e9b64f255fa5ed1f72f7fa3a71884a333b46","impliedFormat":1},{"version":"9c389609ad1e909ad0663d9e84a29091b1c92d2168ce32d64206631af2b31e6a","impliedFormat":1},{"version":"312ff51456514c084938a8f12a45b62e8e19947dba9044cef0f9bc4734da131a","impliedFormat":1},{"version":"783175df41cbdb230182bc8ebaa36f33af86b3307b6219f9aa58e6965bf292de","impliedFormat":1},{"version":"48df809db4c13fadba481f9493e8929a11b42336987eb6e09ba98324effbb0be","impliedFormat":1},{"version":"7759339a5e2c4034bb6f50da51ca2fdba2d1c9c9023589ef5289ec83d64f8af4","impliedFormat":1},{"version":"3632f6e5fa0f5b933c737b3fac185a0b2afead7a58b61f8059d29ced41f48866","impliedFormat":1},{"version":"e53386a2c83ed23edca6e07f9491bb7bd2733c5b164813a3cff80fa8b5f5314f","impliedFormat":1},{"version":"182e2bf7309f78932d27a3a7848a74dbfad9cb3cb26fe2f588e0532d3d70f94e","impliedFormat":1},{"version":"017e69ae35c93ac093ef94424a55c10d1f85e1f50bee7c06355a54ef00d098e5","impliedFormat":1},{"version":"26bbd9de0cc123f8775393c210e67d449e0c3f387c39f14c4e8b8926608d0a35","impliedFormat":1},{"version":"e9b64f72ff8d813536e3665996671914d73dc15dd7f577550f9d93d038893724","impliedFormat":1},{"version":"9f40895097764f2bd2925dfd36d47a881def1c900d0de007de3ed5c5f063feb5","impliedFormat":1},{"version":"31bff3b2d36d0e8eaa39e43ccecca15bbaa291898a26201823ecf8102eef8401","impliedFormat":1},{"version":"36362bd01486a3fdeba908e4e6daf377206da8bc61deb52a357bbe4be75a1a61","impliedFormat":1},{"version":"fd653f6f6cac27f6b810c1282ff70c225a77c913efdb54fae718987d31d3f074","impliedFormat":1},{"version":"4fb7934924b05e3b362f4f7ab82a6500d3115005842bce040d73cfea0f275369","impliedFormat":1},{"version":"22ed70c8f5f987bad190ad0652962b2ff3350c6c2b70c926d56157e9317d7e1b","impliedFormat":1},{"version":"2a907fb2109c3c0b030568124d40ade674dbcaeeb8048e7c3841201f288fb68d","impliedFormat":1},{"version":"1134756f769b63253b227e17170793c31573e6eaaad24693aef47c81e8a94735","impliedFormat":1},{"version":"4bb5f172ab6fbce0315b4752e4e4a16d21fdef52d2f6bfbaf2f83823192f0ac9","impliedFormat":1},{"version":"870cd772dfb73771c29ed5c34cdc8f51fc6115628a4edb35e366c9db3df9c11b","impliedFormat":1},{"version":"9b04c5b66d65ef31912b6cd3065ef66baf07a16eb193911b179291178ea9997e","impliedFormat":1},{"version":"53d17e5ac287f6ac77796692f8621fc018f8b4b5c90d2523d11c5e4f7c60f8bc","impliedFormat":1},{"version":"c0e591ef48d4a1bacb0d4ebdc1dfb43d8a36831146ab73abef205d4befbb0340","impliedFormat":1},{"version":"bb9cc4436840d13ab82137b6f691499b74a1df692a0c692c1e7d13c42bef971c","impliedFormat":1},{"version":"57adb8025a25671a93afb40fb4e4dd9a342242120a064c80a8af7747c08a535b","impliedFormat":1},{"version":"f10c1fc421b6f5c7a230b0325161e2c58bd6353f09965ba7b66e6a63d444b24d","impliedFormat":1},{"version":"f0e4d8bb0a459b7104ee1119cac8320fc540a69c5587ddebbc9be46b85211856","impliedFormat":1},{"version":"83de8fb4aacdbf7ce82317b64e15040e3f08bc392e44a4de155b6042fbf619be","impliedFormat":1},{"version":"77c0e75adec755dcdd56b48b06ff060abce09be968404bdc37ba6887a3c960ff","impliedFormat":1},{"version":"34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","impliedFormat":1},{"version":"7150ae115519a3d91afc25f4a466fa5399f12214ee3e359baa9132a8f3e6d921","impliedFormat":1}],"root":[[150,152]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":199,"noErrorTruncation":true,"noImplicitReturns":true,"noUnusedLocals":true,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9},"fileIdsList":[[129,141,148],[141],[63,141],[98,141],[99,104,132,141],[100,111,112,119,129,140,141],[100,101,111,119,141],[102,141],[103,104,112,120,141],[104,129,137,141],[105,107,111,119,141],[106,141],[107,108,141],[111,141],[109,111,141],[98,111,141],[111,112,113,129,140,141],[111,112,113,126,129,132,141],[96,141,145],[107,111,114,119,129,140,141],[111,112,114,115,119,129,137,140,141],[114,116,129,137,140,141],[63,64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147],[111,117,141],[118,140,141,145],[107,111,119,129,141],[120,141],[121,141],[98,122,141],[123,139,141,145],[124,141],[125,141],[111,126,127,141],[126,128,141,143],[99,111,129,130,131,132,141],[99,129,131,141],[129,130,141],[132,141],[133,141],[98,129,141],[111,135,136,141],[135,136,141],[104,119,129,137,141],[138,141],[119,139,141],[99,114,125,140,141],[104,141],[129,141,142],[118,141,143],[141,144],[99,104,111,113,122,129,140,141,143,145],[129,141,146],[141,154,193],[141,154,178,193],[141,193],[141,154],[141,154,179,193],[141,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192],[141,179,193],[73,77,140,141],[73,129,140,141],[68,141],[70,73,137,140,141],[119,137,141],[141,148],[68,141,148],[70,73,119,140,141],[65,66,69,72,99,111,129,140,141],[65,71,141],[69,73,99,132,140,141,148],[99,141,148],[89,99,141,148],[67,68,141,148],[73,141],[67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,90,91,92,93,94,95,141],[73,80,81,141],[71,73,81,82,141],[72,141],[65,68,73,141],[73,77,81,82,141],[77,141],[71,73,76,140,141],[65,70,71,73,77,80,141],[99,129,141],[68,73,89,99,141,145,148],[112,118,121,141,149],[112,141]],"referencedMap":[[149,1],[153,2],[63,3],[64,3],[98,4],[99,5],[100,6],[101,7],[102,8],[103,9],[104,10],[105,11],[106,12],[107,13],[108,13],[110,14],[109,15],[111,16],[112,17],[113,18],[97,19],[147,2],[114,20],[115,21],[116,22],[148,23],[117,24],[118,25],[119,26],[120,27],[121,28],[122,29],[123,30],[124,31],[125,32],[126,33],[127,33],[128,34],[129,35],[131,36],[130,37],[132,38],[133,39],[134,40],[135,41],[136,42],[137,43],[138,44],[139,45],[140,46],[141,47],[142,48],[143,49],[144,50],[145,51],[146,52],[178,53],[179,54],[154,55],[157,55],[176,53],[177,53],[167,53],[166,56],[164,53],[159,53],[172,53],[170,53],[174,53],[158,53],[171,53],[175,53],[160,53],[161,53],[173,53],[155,53],[162,53],[163,53],[165,53],[169,53],[180,57],[168,53],[156,53],[193,58],[192,2],[187,57],[189,59],[188,57],[181,57],[182,57],[184,57],[186,57],[190,59],[191,59],[183,59],[185,59],[60,2],[61,2],[10,2],[11,2],[15,2],[14,2],[2,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[22,2],[23,2],[3,2],[4,2],[24,2],[28,2],[25,2],[26,2],[27,2],[29,2],[30,2],[31,2],[5,2],[32,2],[33,2],[34,2],[35,2],[6,2],[39,2],[36,2],[37,2],[38,2],[40,2],[7,2],[41,2],[46,2],[47,2],[42,2],[43,2],[44,2],[45,2],[8,2],[51,2],[48,2],[49,2],[50,2],[52,2],[9,2],[53,2],[62,2],[54,2],[55,2],[58,2],[56,2],[57,2],[1,2],[59,2],[13,2],[12,2],[80,60],[87,61],[79,60],[94,62],[71,63],[70,64],[93,65],[88,66],[91,67],[73,68],[72,69],[68,70],[67,71],[90,72],[69,73],[74,74],[75,2],[78,74],[65,2],[96,75],[95,74],[82,76],[83,77],[85,78],[81,79],[84,80],[89,65],[76,81],[77,82],[86,83],[66,84],[92,85],[150,86],[151,87],[152,2]],"exportedModulesMap":[[149,1],[153,2],[63,3],[64,3],[98,4],[99,5],[100,6],[101,7],[102,8],[103,9],[104,10],[105,11],[106,12],[107,13],[108,13],[110,14],[109,15],[111,16],[112,17],[113,18],[97,19],[147,2],[114,20],[115,21],[116,22],[148,23],[117,24],[118,25],[119,26],[120,27],[121,28],[122,29],[123,30],[124,31],[125,32],[126,33],[127,33],[128,34],[129,35],[131,36],[130,37],[132,38],[133,39],[134,40],[135,41],[136,42],[137,43],[138,44],[139,45],[140,46],[141,47],[142,48],[143,49],[144,50],[145,51],[146,52],[178,53],[179,54],[154,55],[157,55],[176,53],[177,53],[167,53],[166,56],[164,53],[159,53],[172,53],[170,53],[174,53],[158,53],[171,53],[175,53],[160,53],[161,53],[173,53],[155,53],[162,53],[163,53],[165,53],[169,53],[180,57],[168,53],[156,53],[193,58],[192,2],[187,57],[189,59],[188,57],[181,57],[182,57],[184,57],[186,57],[190,59],[191,59],[183,59],[185,59],[60,2],[61,2],[10,2],[11,2],[15,2],[14,2],[2,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[22,2],[23,2],[3,2],[4,2],[24,2],[28,2],[25,2],[26,2],[27,2],[29,2],[30,2],[31,2],[5,2],[32,2],[33,2],[34,2],[35,2],[6,2],[39,2],[36,2],[37,2],[38,2],[40,2],[7,2],[41,2],[46,2],[47,2],[42,2],[43,2],[44,2],[45,2],[8,2],[51,2],[48,2],[49,2],[50,2],[52,2],[9,2],[53,2],[62,2],[54,2],[55,2],[58,2],[56,2],[57,2],[1,2],[59,2],[13,2],[12,2],[80,60],[87,61],[79,60],[94,62],[71,63],[70,64],[93,65],[88,66],[91,67],[73,68],[72,69],[68,70],[67,71],[90,72],[69,73],[74,74],[75,2],[78,74],[65,2],[96,75],[95,74],[82,76],[83,77],[85,78],[81,79],[84,80],[89,65],[76,81],[77,82],[86,83],[66,84],[92,85]],"semanticDiagnosticsPerFile":[149,153,63,64,98,99,100,101,102,103,104,105,106,107,108,110,109,111,112,113,97,147,114,115,116,148,117,118,119,120,121,122,123,124,125,126,127,128,129,131,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,178,179,154,157,176,177,167,166,164,159,172,170,174,158,171,175,160,161,173,155,162,163,165,169,180,168,156,193,192,187,189,188,181,182,184,186,190,191,183,185,60,61,10,11,15,14,2,16,17,18,19,20,21,22,23,3,4,24,28,25,26,27,29,30,31,5,32,33,34,35,6,39,36,37,38,40,7,41,46,47,42,43,44,45,8,51,48,49,50,52,9,53,62,54,55,58,56,57,1,59,13,12,80,87,79,94,71,70,93,88,91,73,72,68,67,90,69,74,75,78,65,96,95,82,83,85,81,84,89,76,77,86,66,92,150,151,152]},"version":"5.2.2"}
|
|
1
|
+
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/fetchMocker.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@hedia/html/dist/src/index.d.ts","../src/reporters/sonarcloud.ts","../src/reporters/test.ts","../test/fetchMocker.test.ts","../test/index.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","impliedFormat":1},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true,"impliedFormat":1},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true,"impliedFormat":1},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true,"impliedFormat":1},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true,"impliedFormat":1},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true,"impliedFormat":1},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3481c92beb91b0eac6f5bab11c0085f4ff514babea98c257359ecdb55d3d63e","signature":"66779f853ce4ad91f6d576c5bc2e81944a5836baeb5a353543891c7b7eb3d816","impliedFormat":99},{"version":"2db0dd3aaa2ed285950273ce96ae8a450b45423aa9da2d10e194570f1233fa6b","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","impliedFormat":1},{"version":"3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","impliedFormat":1},{"version":"e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","impliedFormat":1},{"version":"471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","impliedFormat":1},{"version":"c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","impliedFormat":1},{"version":"40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","impliedFormat":1},{"version":"8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","impliedFormat":1},{"version":"4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1","impliedFormat":1},{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true,"impliedFormat":1},{"version":"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36","impliedFormat":1},{"version":"392eadc2af403dd10b4debfbc655c089a7fa6a9750caeb770cfb30051e55e848","affectsGlobalScope":true,"impliedFormat":1},{"version":"b67f9c5d42e7770ddf8b6d1747b531275c44617e8071d2602a2cffd2932ad95e","impliedFormat":1},{"version":"53f0960fdcc53d097918adfd8861ffbe0db989c56ffc16c052197bf115da5ed6","impliedFormat":1},{"version":"662163e5327f260b23ca0a1a1ad8a74078aabb587c904fcb5ef518986987eaff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"c48c503c6b3f63baf18257e9a87559b5602a4e960107c762586d2a6a62b64a18","affectsGlobalScope":true,"impliedFormat":1},{"version":"b0c0d1d13be149f790a75b381b413490f98558649428bb916fd2d71a3f47a134","impliedFormat":1},{"version":"3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","impliedFormat":1},{"version":"3bb6e21a9f30417c0a059e240b3f8f70c8af9c4cb6f2fd1bc2db594c647e285f","impliedFormat":1},{"version":"7483ef24249f6a3e24eb3d8136ec7fe0633cd6f8ffe752e2a8d99412aff35bb7","impliedFormat":1},{"version":"d0ca5d7df114035258a9d01165be309371fcccf0cccd9d57b1453204686d1ed0","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"1bb9aab2311a9d596a45dba7c378b4e23846738d9bae54d60863dd3676b1edbc","affectsGlobalScope":true,"impliedFormat":1},{"version":"173b6275a81ebdb283b180654890f46516c21199734fed01a773b1c168b8c45c","impliedFormat":1},{"version":"304f66274aa8119e8d65a49b1cff84cbf803def6afe1b2cc987386e9a9890e22","impliedFormat":1},{"version":"1b9adafe8a7fefaeaf9099a0e06f602903f6268438147b843a33a5233ac71745","impliedFormat":1},{"version":"98273274f2dbb79b0b2009b20f74eca4a7146a3447c912d580cd5d2d94a7ae30","impliedFormat":1},{"version":"c933f7ba4b201c98b14275fd11a14abb950178afd2074703250fe3654fc10cd2","impliedFormat":1},{"version":"2eaa31492906bc8525aff3c3ec2236e22d90b0dfeee77089f196cd0adf0b3e3b","impliedFormat":1},{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f5814f29dbaf8bacd1764aebdf1c8a6eb86381f6a188ddbac0fcbaab855ce52","impliedFormat":1},{"version":"a63d03de72adfb91777784015bd3b4125abd2f5ef867fc5a13920b5649e8f52b","impliedFormat":1},{"version":"d20e003f3d518a7c1f749dbe27c6ab5e3be7b3c905a48361b04a9557de4a6900","impliedFormat":1},{"version":"1d4d78c8b23c9ddaaaa49485e6adc2ec01086dfe5d8d4d36ca4cdc98d2f7e74a","affectsGlobalScope":true,"impliedFormat":1},{"version":"44fc16356b81c0463cc7d7b2b35dcf324d8144136f5bc5ce73ced86f2b3475b5","affectsGlobalScope":true,"impliedFormat":1},{"version":"575fb200043b11b464db8e42cc64379c5fd322b6d787638e005b5ee98a64486d","impliedFormat":1},{"version":"6de2f225d942562733e231a695534b30039bdf1875b377bb7255881f0df8ede8","impliedFormat":1},{"version":"56249fd3ef1f6b90888e606f4ea648c43978ef43a7263aafad64f8d83cd3b8aa","impliedFormat":1},{"version":"139ad1dc93a503da85b7a0d5f615bddbae61ad796bc68fedd049150db67a1e26","impliedFormat":1},{"version":"7b166975fdbd3b37afb64707b98bca88e46577bbc6c59871f9383a7df2daacd1","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"81505c54d7cad0009352eaa21bd923ab7cdee7ec3405357a54d9a5da033a2084","impliedFormat":1},{"version":"269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"3c1f19c7abcda6b3a4cf9438a15c7307a080bd3b51dfd56b198d9f86baf19447","impliedFormat":1},{"version":"2ee1645e0df9d84467cfe1d67b0ad3003c2f387de55874d565094464ee6f2927","impliedFormat":1},{"version":"abe61b580e030f1ca3ee548c8fd7b40fc686a97a056d5d1481f34c39c637345f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9cf780e96b687e4bdfd1907ed26a688c18b89797490a00598fa8b8ab683335dd","affectsGlobalScope":true,"impliedFormat":1},{"version":"98e00f3613402504bc2a2c9a621800ab48e0a463d1eed062208a4ae98ad8f84c","impliedFormat":1},{"version":"9ae88ce9f73446c24b2d2452e993b676da1b31fca5ceb7276e7f36279f693ed1","impliedFormat":1},{"version":"e49d7625faff2a7842e4e7b9b197f972633fca685afcf6b4403400c97d087c36","impliedFormat":1},{"version":"b82c38abc53922b1b3670c3af6f333c21b735722a8f156e7d357a2da7c53a0a0","impliedFormat":1},{"version":"b423f53647708043299ded4daa68d95c967a2ac30aa1437adc4442129d7d0a6c","affectsGlobalScope":true,"impliedFormat":1},{"version":"7245af181218216bacb01fbdf51095617a51661f20d77178c69a377e16fb69ed","affectsGlobalScope":true,"impliedFormat":1},{"version":"4f0fc7b7f54422bd97cfaf558ddb4bca86893839367b746a8f86b60ac7619673","impliedFormat":1},{"version":"4cdd8b6b51599180a387cc7c1c50f49eca5ce06595d781638fd0216520d98246","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"ac14eb65c59722f0333e776a73e6a02cea23b5aa857a749ea176daf4e960e872","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c6929fd7cbf38499b6a600b91c3b603d1d78395046dc3499b2b92d01418b94b","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a42be67ed1ddaec743582f41fc219db96a1b69719fccac6d1464321178d610fc","impliedFormat":1},{"version":"35a2ba237c15899b076f20459cf8ab16360c5a6545be6778e75ab461ad94979d","impliedFormat":99},{"version":"20cab15727a473fb8d9c1547a20a98b69dcf50225fc024c311d31836a54f0798","signature":"3183155522f224a465b0554392814122b1c25fba5839372989b2e87772d19dc0","impliedFormat":99},{"version":"f37931475107cf3e7afcb22277d45e785b8b56d4ad51652dea0926e5a841ff5c","signature":"85503e3410a7f50492cbd74c104329869eead5d6a4dc1139ed5a0ba448be8f83","impliedFormat":99},{"version":"e7f883de1fa87e3c65b142abebd01f4ad43209f0b8aec34eff3fd33768364eb2","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":99},{"version":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","impliedFormat":99}],"root":[62,[151,154]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":199,"noErrorTruncation":true,"noImplicitReturns":true,"noUnusedLocals":true,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9},"fileIdsList":[[130,149],[63],[98],[99,104,133],[100,105,111,112,119,130,141],[100,101,111,119],[102,142],[103,104,112,120],[104,130,138],[105,107,111,119],[98,106],[107,108],[111],[109,111],[98,111],[111,112,113,130,141],[111,112,113,126,130,133],[96,99,146],[107,111,114,119,130,141],[111,112,114,115,119,130,138,141],[114,116,130,138,141],[63,64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[111,117],[118,141,146],[107,111,119,130],[120],[121],[98,122],[119,120,123,140,146],[124],[125],[111,126,127],[126,128,142,144],[99,111,130,131,132,133],[99,130,132],[130,131],[133],[134],[98,130],[111,136,137],[136,137],[104,119,130,138],[139],[119,140],[99,114,125,141],[104,142],[130,143],[118,144],[145],[99,104,111,113,122,130,141,144,146],[130,147],[73,77,141],[73,130,141],[68],[70,73,138,141],[119,138],[149],[68,149],[70,73,119,141],[65,66,69,72,99,111,130,141],[65,71],[69,73,99,133,141,149],[99,149],[89,99,149],[67,68,149],[73],[67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,90,91,92,93,94,95],[73,80,81],[71,73,81,82],[72],[65,68,73],[73,77,81,82],[77],[71,73,76,141],[65,70,71,73,77,80],[99,130],[68,73,89,99,146,149],[135],[112,118,121,150],[112],[62,63,114,135]],"referencedMap":[[150,1],[63,2],[64,2],[98,3],[99,4],[100,5],[101,6],[102,7],[103,8],[104,9],[105,10],[106,11],[107,12],[108,12],[110,13],[109,14],[111,15],[112,16],[113,17],[97,18],[114,19],[115,20],[116,21],[149,22],[117,23],[118,24],[119,25],[120,26],[121,27],[122,28],[123,29],[124,30],[125,31],[126,32],[127,32],[128,33],[130,34],[132,35],[131,36],[133,37],[134,38],[135,39],[136,40],[137,41],[138,42],[139,43],[140,44],[141,45],[142,46],[143,47],[144,48],[145,49],[146,50],[147,51],[80,52],[87,53],[79,52],[94,54],[71,55],[70,56],[93,57],[88,58],[91,59],[73,60],[72,61],[68,62],[67,63],[90,64],[69,65],[74,66],[78,66],[96,67],[95,66],[82,68],[83,69],[85,70],[81,71],[84,72],[89,57],[76,73],[77,74],[86,75],[66,76],[92,77],[62,78],[151,79],[152,80],[153,81]],"exportedModulesMap":[[150,1],[63,2],[64,2],[98,3],[99,4],[100,5],[101,6],[102,7],[103,8],[104,9],[105,10],[106,11],[107,12],[108,12],[110,13],[109,14],[111,15],[112,16],[113,17],[97,18],[114,19],[115,20],[116,21],[149,22],[117,23],[118,24],[119,25],[120,26],[121,27],[122,28],[123,29],[124,30],[125,31],[126,32],[127,32],[128,33],[130,34],[132,35],[131,36],[133,37],[134,38],[135,39],[136,40],[137,41],[138,42],[139,43],[140,44],[141,45],[142,46],[143,47],[144,48],[145,49],[146,50],[147,51],[80,52],[87,53],[79,52],[94,54],[71,55],[70,56],[93,57],[88,58],[91,59],[73,60],[72,61],[68,62],[67,63],[90,64],[69,65],[74,66],[78,66],[96,67],[95,66],[82,68],[83,69],[85,70],[81,71],[84,72],[89,57],[76,73],[77,74],[86,75],[66,76],[92,77],[62,78]],"semanticDiagnosticsPerFile":[150,63,64,98,99,100,101,102,103,104,105,106,107,108,110,109,111,112,113,97,148,114,115,116,149,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,131,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,60,61,12,11,2,13,14,15,16,17,18,19,20,3,21,4,22,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,58,10,1,59,80,87,79,94,71,70,93,88,91,73,72,68,67,90,69,74,75,78,65,96,95,82,83,85,81,84,89,76,77,86,66,92,62,151,152,153,154]},"version":"5.4.5"}
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
2
|
+
"name": "@hedia/test",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Custom Test Reporters",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./reporters/sonarcloud": "./dist/src/reporters/sonarcloud.js",
|
|
8
|
+
"./reporters/test": "./dist/src/reporters/test.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build:watch": "tsc --watch",
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "concurrently \"npm run build:watch\" \"npm run start:watch\"",
|
|
14
|
+
"eslint:fix": "eslint . --fix",
|
|
15
|
+
"eslint": "eslint .",
|
|
16
|
+
"prettier:check": "prettier --check .",
|
|
17
|
+
"prettier:write": "prettier --write .",
|
|
18
|
+
"start:watch": "node --enable-source-maps --watch .",
|
|
19
|
+
"start": "node --enable-source-maps .",
|
|
20
|
+
"test": "node --enable-source-maps --test --experimental-test-coverage --test-reporter spec --test-reporter @hedia/test/reporters/sonarcloud --test-reporter-destination stdout --test-reporter-destination coverage.xml --test-concurrency 1",
|
|
21
|
+
"tsc": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/hedia-team/test.git"
|
|
26
|
+
},
|
|
27
|
+
"author": "Mathieu Veber <mathieu@hedia.com>",
|
|
28
|
+
"license": "UNLICENSED",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/hedia-team/test/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/hedia-team/test#readme",
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@hedia/eslint-config": "4.0.2",
|
|
35
|
+
"@hedia/prettier-config": "1.0.6",
|
|
36
|
+
"@hedia/tsconfig": "1.2.2",
|
|
37
|
+
"@types/node": "^20.14.2",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "7.12.0",
|
|
39
|
+
"@typescript-eslint/parser": "7.12.0",
|
|
40
|
+
"eslint": "8.57.0",
|
|
41
|
+
"prettier": "^3.3.1"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@hedia/html": "^2.0.4"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20",
|
|
48
|
+
"npm": ">=10"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"src"
|
|
53
|
+
],
|
|
54
|
+
"prettier": "@hedia/prettier-config"
|
|
55
55
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Mock, mock } from "node:test";
|
|
2
|
+
|
|
3
|
+
interface TestContext {
|
|
4
|
+
mock: {
|
|
5
|
+
method: (objectToMock: object, methodToMock: string, implementation: typeof fetch) => Mock<typeof fetch>;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface FetchMock {
|
|
10
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
11
|
+
resource: string | URL | RegExp;
|
|
12
|
+
fetchImplementation: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface UsedIndicator {
|
|
16
|
+
used: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class FetchMocker {
|
|
20
|
+
private readonly originalFetch: typeof fetch;
|
|
21
|
+
mockedFetch: Mock<typeof fetch>;
|
|
22
|
+
mocks: (FetchMock & UsedIndicator)[] = [];
|
|
23
|
+
verbose: boolean;
|
|
24
|
+
|
|
25
|
+
constructor(testContext?: TestContext, verbose = false) {
|
|
26
|
+
this.originalFetch = fetch;
|
|
27
|
+
if (testContext) {
|
|
28
|
+
this.mockedFetch = testContext.mock.method(global, "fetch", this.customFetch.bind(this));
|
|
29
|
+
} else {
|
|
30
|
+
this.mockedFetch = mock.method(global, "fetch", this.customFetch.bind(this));
|
|
31
|
+
}
|
|
32
|
+
this.verbose = verbose;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
addMock(mock: FetchMock) {
|
|
36
|
+
this.mocks.push({ ...mock, used: false });
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async customFetch(resource: string | URL | Request, options?: RequestInit) {
|
|
41
|
+
const requestMethod: string = options?.method ?? "GET";
|
|
42
|
+
const requestedUrl = new URL(resource instanceof Request ? resource.url : resource);
|
|
43
|
+
|
|
44
|
+
for (const mock of this.mocks) {
|
|
45
|
+
if (mock.method && mock.method != requestMethod) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (mock.resource instanceof RegExp) {
|
|
50
|
+
if (!mock.resource.test(requestedUrl.toString())) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
const mockedUrl = new URL(mock.resource);
|
|
55
|
+
|
|
56
|
+
const searchParamsMatch = Array.from(mockedUrl.searchParams).every(
|
|
57
|
+
([key, value]) => requestedUrl.searchParams.has(key) && requestedUrl.searchParams.get(key) == value,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
if (
|
|
61
|
+
requestedUrl.origin != mockedUrl.origin ||
|
|
62
|
+
requestedUrl.pathname != mockedUrl.pathname ||
|
|
63
|
+
!searchParamsMatch
|
|
64
|
+
) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (this.verbose) {
|
|
70
|
+
console.log(`using mock to handle ${requestMethod ?? "GET"} ${requestedUrl.toString()}`);
|
|
71
|
+
}
|
|
72
|
+
mock.used = true;
|
|
73
|
+
return await mock.fetchImplementation(resource, options);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this.verbose) {
|
|
77
|
+
console.log(`using original fetch to handle ${requestMethod ?? "GET"} ${requestedUrl.toString()}`);
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
return await this.originalFetch(resource, options);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (options?.redirect !== "manual") {
|
|
83
|
+
console.warn(
|
|
84
|
+
`WARNING: The original fetch function failed to ${requestMethod ?? "GET"} ${requestedUrl.toString()}. Did you ` +
|
|
85
|
+
"forget to mock a resource or to set redirect=manual? The following error occurred when calling the original fetch function from the " +
|
|
86
|
+
"mock. This could indicate that fetch tried to follow a redirect to something that is not " +
|
|
87
|
+
"available.",
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
allMocksUsed(): boolean {
|
|
95
|
+
const result = this.mocks.every((mock) => mock.used);
|
|
96
|
+
if (!result) {
|
|
97
|
+
console.warn("WARNING: Not all the defined mocks were used.");
|
|
98
|
+
for (const mock of this.mocks) {
|
|
99
|
+
if (!mock.used) {
|
|
100
|
+
console.warn(`- Mock for ${mock.resource.toString()} was not used.`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -51,15 +51,14 @@ function getOriginalFilesFromCoverageEvent(event: Event) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
for (const line of file.lines) {
|
|
54
|
-
|
|
55
|
-
const entry: Entry = sourceMap?.findOrigin(line.line, 1);
|
|
54
|
+
const entry = sourceMap?.findOrigin(line.line, 1) as Entry;
|
|
56
55
|
|
|
57
56
|
if (entry) {
|
|
58
57
|
originalFiles[entry.fileName] = originalFiles[entry.fileName] || new Map();
|
|
59
58
|
|
|
60
59
|
const originalFile = originalFiles[entry.fileName];
|
|
61
60
|
|
|
62
|
-
const count = (originalFile.get(entry.lineNumber)
|
|
61
|
+
const count = (originalFile.get(entry.lineNumber) ?? 0) + line.count;
|
|
63
62
|
|
|
64
63
|
originalFile.set(entry.lineNumber, count);
|
|
65
64
|
}
|