Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upate dev dependencies #2013

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/android/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export class Android {
)
);
const wifiInfo = rawWifiInfo.toString().trim();
const wifi = wifiInfo.match(/"[^"]*"|^[^"]*$/)[0].replace(/"/g, '');
const wifi = wifiInfo.match(/"[^"]*"|^[^"]*$/)[0].replaceAll('"', '');
return wifi;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/core/engine/command/click.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class Click {
async byXpath(xpath) {
try {
// This is how Selenium do internally
const replaced = xpath.replace(/"/g, "'");
const replaced = xpath.replaceAll('"', "'");
const script = `document.evaluate("${replaced}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`;
return this.browser.runScript(script, 'CUSTOM');
} catch (error) {
Expand All @@ -148,7 +148,7 @@ export class Click {
async byXpathAndWait(xpath) {
try {
// This is how Selenium do internally
const replaced = xpath.replace(/"/g, "'");
const replaced = xpath.replaceAll('"', "'");
const script = `document.evaluate("${replaced}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`;
await this.browser.runScript(script, 'CUSTOM');
return this.browser.extraWait(this.pageCompleteCheck);
Expand Down
6 changes: 3 additions & 3 deletions lib/core/engine/command/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ export class Measure {
// If we have tested pages before, but not in the making of
// measuring a page, associate the error with that latest page.
if (this.result.length > 0) {
if (this.result[this.result.length - 1].error === undefined) {
this.result[this.result.length - 1].error = [message];
if (this.result.at(-1).error === undefined) {
this.result.at(-1).error = [message];
} else {
this.result[this.result.length - 1].error.push(message);
this.result.at(-1).error.push(message);
}
} else {
// error not associated to a start/run so far
Expand Down
4 changes: 2 additions & 2 deletions lib/support/pathToFolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const log = intel.getLogger('browsertime');

function toSafeKey(key) {
// U+2013 : EN DASH – as used on https://en.wikipedia.org/wiki/2019–20_coronavirus_pandemic
return key.replace(/[ %&()+,./:?|~–]|%7C/g, '-');
return key.replaceAll(/[ %&()+,./:?|~–]|%7C/g, '-');
}

export function pathToFolder(url, options) {
Expand Down Expand Up @@ -59,7 +59,7 @@ export function pathToFolder(url, options) {

for (const [index, segment] of pathSegments.entries()) {
if (segment) {
pathSegments[index] = segment.replace(/[^\w.\u0621-\u064A-]/gi, '-');
pathSegments[index] = segment.replaceAll(/[^\w.\u0621-\u064A-]/gi, '-');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/support/storageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const mkdir = promisify(_mkdir);
const log = intel.getLogger('browsertime');

const defaultDir = 'browsertime-results';
let timestamp = dayjs().format().replace(/:/g, '');
let timestamp = dayjs().format().replaceAll(':', '');

function pathNameFromUrl(url) {
const parsedUrl = parse(url),
Expand Down
Loading