Skip to content

Commit

Permalink
chore: update TestCafe to 3.5.0, update devDependencies (`@types/node…
Browse files Browse the repository at this point in the history
…`, etc)
  • Loading branch information
uid11 committed Dec 31, 2023
1 parent ab3e25c commit 8121348
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 89 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2021-2023 SIA Joom
Copyright (c) 2021-2024 SIA Joom

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ If the mapping returns `undefined`, the log entry is not skipped, but is printed
For example, if it is equal to three, the test will be run no more than three times.

`overriddenUserAgent: string | null`: if not `null`, then this value will override the browser's user agent in tests.
This override only works when `enableChromeDevToolsProtocol` is `true`.

`packTimeout: number`: timeout (in millisecond) for the entire pack of tests (tasks).
If the test pack takes longer than this timeout, the pack will fail with the appropriate error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ sed -i "s|\x22@types/node\x22: \x22[^\x22]*\x22,||" ./bin/forks/testcafe-without
sed -i "s/\x22bin-v8-flags-filter\x22: \x22[^\x22]*\x22,/\x22bin-v8-flags-filter\x22: \x221.2.0\x22,/" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s/\x22globby\x22: \x22[^\x22]*\x22,/\x22globby\x22: \x2211.1.0\x22,/" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s/\x22pngjs\x22: \x22[^\x22]*\x22,/\x22pngjs\x22: \x227.0.0\x22,/" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s/\x22testcafe-hammerhead\x22: \x22[^\x22]*\x22,/\x22testcafe-hammerhead-up\x22: \x2231.6.3-rc.1\x22,/" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s/\x22testcafe-hammerhead\x22: \x22[^\x22]*\x22,/\x22testcafe-hammerhead-up\x22: \x2231.7.0-rc.1\x22,/" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s|\x22testcafe-reporter-spec\x22: \x22[^\x22]*\x22,|\x22testcafe-reporter-for-e2ed\x22: \x220.0.4\x22,|" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s/\x22typescript\x22: \x22[^\x22]*\x22,//" ./bin/forks/testcafe-without-typecheck/package/package.json

sed -i "s|\x22devDependencies\x22|\x22peerDependencies\x22: {\x22@types/node\x22: \x22>=18\x22, \x22typescript\x22: \x22>=4\x22},\x22devDependencies\x22|" ./bin/forks/testcafe-without-typecheck/package/package.json
sed -i "s|\x22devDependencies\x22|\x22peerDependencies\x22: {\x22@types/node\x22: \x22>=20\x22, \x22typescript\x22: \x22>=5\x22},\x22devDependencies\x22|" ./bin/forks/testcafe-without-typecheck/package/package.json

175 changes: 100 additions & 75 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"get-modules-graph": "0.0.9",
"globby": "11.1.0",
"pngjs": "7.0.0",
"testcafe-without-typecheck": "3.4.0-rc.1"
"testcafe-without-typecheck": "3.5.0-rc.1"
},
"devDependencies": {
"@types/node": "20.10.5",
"@typescript-eslint/eslint-plugin": "6.14.0",
"@typescript-eslint/parser": "6.14.0",
"@types/node": "20.10.6",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"assert-modules-support-case-insensitive-fs": "1.0.1",
"assert-package-lock-is-consistent": "1.0.0",
"eslint": "8.56.0",
Expand All @@ -45,7 +45,7 @@
"eslint-plugin-typescript-sort-keys": "3.1.0",
"husky": "8.0.3",
"prettier": "3.1.1",
"testcafe": "3.4.0",
"testcafe": "3.5.0",
"typescript": "5.3.3"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/ApiRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export abstract class ApiRoute<
declare readonly [RESPONSE_KEY]: SomeResponse;

/**
* Return true, if the request body is in JSON format.
* Returns `true`, if the request body is in JSON format.
*/
getIsRequestBodyInJsonFormat(): boolean {
return true;
}

/**
* Return true, if the response body is in JSON format.
* Returns `true`, if the response body is in JSON format.
*/
getIsResponseBodyInJsonFormat(): boolean {
return true;
Expand Down
4 changes: 3 additions & 1 deletion src/actions/takeScreenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {getPromiseWithResolveAndReject} from '../utils/promise';
import type {Inner} from 'testcafe-without-typecheck';

type TakeScreenshot = ((path?: string) => Promise<void>) &
((options: Inner.TakeScreenshotOptions & Readonly<{timeout?: number}>) => Promise<void>);
((
options: Omit<Inner.TakeScreenshotOptions, 'pathPattern'> & Readonly<{timeout?: number}>,
) => Promise<void>);

/**
* Takes a screenshot of the tested page.
Expand Down
1 change: 1 addition & 0 deletions src/types/config/ownE2edConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export type OwnE2edConfig<

/**
* If not `null`, then this value will override the browser's user agent in tests.
* This override only works when `enableChromeDevToolsProtocol` is `true`.
*/
overriddenUserAgent: string | null;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/clientFunction/isNeedRerunClientFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {ClientFunctionState, MaybeTestCafeError} from '../../types/internal
const INTERRUPTED_BY_PAGE_UNLOAD_CODE = 'E49';

/**
* Return true if client function rerun is needed, false otherwise.
* Returns `true` if client function rerun is needed and `false` otherwise.
* @internal
*/
export const isNeedRerunClientFunction = <Args extends readonly unknown[], Result>(
Expand Down
3 changes: 1 addition & 2 deletions src/utils/report/client/sanitizeHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export function sanitizeHtml(
String(value)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');

Expand Down Expand Up @@ -93,5 +92,5 @@ export function sanitizeHtml(
* @internal
*/
export function sanitizeJson(json: string): string {
return json.replace(/</g, '&lt;').replace(/>/g, '&gt;');
return json.replace(/</g, '&lt;');
}

0 comments on commit 8121348

Please sign in to comment.