mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: replace rimraf with a helper in BrowserFetcher/Connector (#9890)
This commit is contained in:
@@ -23,8 +23,9 @@ import {
|
||||
PuppeteerLaunchOptions,
|
||||
PuppeteerNode,
|
||||
} from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
import {rmSync} from 'puppeteer-core/internal/util/fs.js';
|
||||
|
||||
import {getTestState, rmSync} from './mocha-utils.js';
|
||||
import {getTestState} from './mocha-utils.js';
|
||||
|
||||
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
|
||||
|
||||
|
||||
@@ -23,9 +23,10 @@ import {Protocol} from 'devtools-protocol';
|
||||
import expect from 'expect';
|
||||
import {BrowserFetcher, TimeoutError} from 'puppeteer';
|
||||
import {Page} from 'puppeteer-core/internal/api/Page.js';
|
||||
import {rmSync} from 'puppeteer-core/internal/util/fs.js';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import {getTestState, itOnlyRegularInstall, rmSync} from './mocha-utils.js';
|
||||
import {getTestState, itOnlyRegularInstall} from './mocha-utils.js';
|
||||
import utils from './utils.js';
|
||||
|
||||
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
|
||||
|
||||
@@ -34,6 +34,7 @@ import {
|
||||
PuppeteerNode,
|
||||
} from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
import {isErrorLike} from 'puppeteer-core/internal/util/ErrorLike.js';
|
||||
import {rmSync} from 'puppeteer-core/internal/util/fs.js';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import {extendExpectWithToBeGolden} from './utils.js';
|
||||
@@ -331,11 +332,3 @@ export const createTimeout = <T>(
|
||||
}, n);
|
||||
});
|
||||
};
|
||||
|
||||
export function rmSync(target: string): void {
|
||||
fs.rmSync(target, {
|
||||
force: true,
|
||||
recursive: true,
|
||||
maxRetries: 5,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user