Skip to content

Commit de1ef98

Browse files
Upgrade: Bump typescript from 4.3.5 to 4.5.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.5.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.3.5...v4.5.5) - - - - - - - - - - - - - - - - - - - - Close #4996 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Christy Chen <christychen126@gmail.com>
1 parent addc5fc commit de1ef98

File tree

132 files changed

+189
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+189
-176
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"semver": "^7.3.5",
3636
"shelljs": "^0.8.5",
3737
"tsort": "^0.0.1",
38-
"typescript": "^4.3.5",
38+
"typescript": "^4.5.5",
3939
"unzipper": "^0.10.11",
4040
"yargs": "^17.3.1"
4141
},

packages/connector-jsdom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"nyc": "^15.1.0",
3939
"rimraf": "^3.0.2",
4040
"sinon": "^13.0.1",
41-
"typescript": "^4.3.5"
41+
"typescript": "^4.5.5"
4242
},
4343
"files": [
4444
"dist/src"

packages/connector-jsdom/src/connector.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,11 @@ export default class JSDOMConnector implements IConnector {
186186
try {
187187
this._targetNetworkData = await this.fetchContent(target);
188188
} catch (err) /* istanbul ignore next */ {
189-
const hops: string[] = this.request.getRedirects(err.uri);
189+
const e = err as any;
190+
const hops: string[] = this.request.getRedirects(e.uri);
190191
const fetchError: FetchError = {
191192
element: null as any,
192-
error: err.error ? err.error : err,
193+
error: e.error ? e.error : e,
193194
hops,
194195
resource: href
195196
};

packages/connector-jsdom/src/evaluate-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const run = async (data: { options: any; source: string }) => {
8080

8181
result.evaluate = evaluteResult;
8282
} catch (err) {
83-
result.error = err;
83+
result.error = err as Error;
8484
}
8585

8686
process.send!(result);

packages/connector-jsdom/src/resource-loader.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,14 @@ export default class CustomResourceLoader extends ResourceLoader {
9292

9393
return resolve(resourceNetworkData.response.body.rawContent);
9494
} catch (err) {
95-
const hops: string[] = this._connector.request.getRedirects(err.uri);
95+
const error = err as any;
96+
const hops: string[] = this._connector.request.getRedirects(error.uri);
9697
const fetchError: FetchError = {
9798
element: element!,
98-
error: err.error,
99+
error: error.error,
99100
hops,
100101
/* istanbul ignore next */
101-
resource: err.uri || resourceUrl
102+
resource: error.uri || resourceUrl
102103
};
103104

104105
await this._connector.server.emitAsync('fetch::error', fetchError);

packages/connector-local/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"proxyquire": "^2.1.3",
3939
"rimraf": "^3.0.2",
4040
"sinon": "^13.0.1",
41-
"typescript": "^4.3.5"
41+
"typescript": "^4.5.5"
4242
},
4343
"files": [
4444
"dist/src"

packages/connector-local/tests/tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,6 @@ test('If target is a not a file, it should throw and exception', async (t) => {
577577
try {
578578
await connector.collect(new URL('https://example.com'));
579579
} catch (err) {
580-
t.is(err.message, 'Connector local only works with local files or directories');
580+
t.is((err as Error).message, 'Connector local only works with local files or directories');
581581
}
582582
});

packages/connector-puppeteer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"puppeteer": "^10.4.0",
4545
"rimraf": "^3.0.2",
4646
"sinon": "^13.0.1",
47-
"typescript": "^4.3.5"
47+
"typescript": "^4.5.5"
4848
},
4949
"files": [
5050
"dist/src"

packages/connector-puppeteer/src/lib/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const group = (actions: ActionConfig[] = []): UserActions => {
3232
try {
3333
loadedAction = require(pathToUserAction);
3434
} catch (e) {
35-
throw new Error(`Couldn't load user action in "${pathToUserAction}". ${e.message}`);
35+
throw new Error(`Couldn't load user action in "${pathToUserAction}". ${(e as Error).message}`);
3636
}
3737

3838
if (typeof loadedAction.action !== 'function') {

packages/connector-puppeteer/tests/actions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test(`[${name}] Connector throws an exception if action is not found`, (t) => {
3434

3535
connector.close();
3636
} catch (e) {
37-
t.true((e.message as string).startsWith(`Couldn't load user action in "`));
37+
t.true(((e as Error).message).startsWith(`Couldn't load user action in "`));
3838
}
3939
});
4040

@@ -71,7 +71,7 @@ test(`[${name}] Connector loads an action and throws if it does not have the rig
7171

7272
connector.close();
7373
} catch (e) {
74-
t.is(e.message, `User action "${actionPath}" doesn't export a member "action".`);
74+
t.is((e as Error).message, `User action "${actionPath}" doesn't export a member "action".`);
7575
}
7676
});
7777

@@ -109,6 +109,6 @@ test(`[${name}] Connector loads an action and doesn't throw if it has the right
109109

110110
connector.close();
111111
} catch (e) {
112-
t.fail(e.message);
112+
t.fail((e as Error).message);
113113
}
114114
});

0 commit comments

Comments
 (0)