refactor: use replaceAll()
instead of replace()
when appropriate (#39721)
refactor: use replaceAll() instead of replace() when appropriate
This commit is contained in:
parent
029127a8b6
commit
f6e8544ef6
10 changed files with 20 additions and 20 deletions
|
@ -3425,7 +3425,7 @@ describe('BrowserWindow module', () => {
|
|||
w.loadURL(pageUrl);
|
||||
const [, url] = await once(ipcMain, 'answer');
|
||||
const expectedUrl = process.platform === 'win32'
|
||||
? 'file:///' + htmlPath.replace(/\\/g, '/')
|
||||
? 'file:///' + htmlPath.replaceAll('\\', '/')
|
||||
: pageUrl;
|
||||
expect(url).to.equal(expectedUrl);
|
||||
});
|
||||
|
@ -3475,7 +3475,7 @@ describe('BrowserWindow module', () => {
|
|||
w.loadURL(pageUrl);
|
||||
const [, { url, frameName, options }] = await once(w.webContents, 'did-create-window') as [BrowserWindow, Electron.DidCreateWindowDetails];
|
||||
const expectedUrl = process.platform === 'win32'
|
||||
? 'file:///' + htmlPath.replace(/\\/g, '/')
|
||||
? 'file:///' + htmlPath.replaceAll('\\', '/')
|
||||
: pageUrl;
|
||||
expect(url).to.equal(expectedUrl);
|
||||
expect(frameName).to.equal('popup!');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue