Skip to content

Commit 7dd17d5

Browse files
authored
docs: Replace rimraf with fsPromises.rm in Puppeteer.md (#11957)
1 parent b439692 commit 7dd17d5

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ Finally, we can close the puppeteer instance and clean-up the file
121121

122122
```js
123123
// teardown.js
124+
const fs = require('fs').promises;
124125
const os = require('os');
125126
const path = require('path');
126-
const rimraf = require('rimraf');
127127

128128
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
129129
module.exports = async function () {
130130
// close the browser instance
131131
await global.__BROWSER_GLOBAL__.close();
132132

133133
// clean-up the wsEndpoint file
134-
rimraf.sync(DIR);
134+
await fs.rm(DIR, {recursive: true, force: true});
135135
};
136136
```
137137

website/versioned_docs/version-25.x/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ Finally, we can close the puppeteer instance and clean-up the file
121121

122122
```js
123123
// teardown.js
124+
const fs = require('fs').promises;
124125
const os = require('os');
125126
const path = require('path');
126-
const rimraf = require('rimraf');
127127

128128
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
129129
module.exports = async function () {
130130
// close the browser instance
131131
await global.__BROWSER_GLOBAL__.close();
132132

133133
// clean-up the wsEndpoint file
134-
rimraf.sync(DIR);
134+
await fs.rm(DIR, {recursive: true, force: true});
135135
};
136136
```
137137

website/versioned_docs/version-26.x/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ Finally, we can close the puppeteer instance and clean-up the file
121121

122122
```js
123123
// teardown.js
124+
const fs = require('fs').promises;
124125
const os = require('os');
125126
const path = require('path');
126-
const rimraf = require('rimraf');
127127

128128
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
129129
module.exports = async function () {
130130
// close the browser instance
131131
await global.__BROWSER_GLOBAL__.close();
132132

133133
// clean-up the wsEndpoint file
134-
rimraf.sync(DIR);
134+
await fs.rm(DIR, {recursive: true, force: true});
135135
};
136136
```
137137

website/versioned_docs/version-27.0/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ Finally, we can close the puppeteer instance and clean-up the file
121121

122122
```js
123123
// teardown.js
124+
const fs = require('fs').promises;
124125
const os = require('os');
125126
const path = require('path');
126-
const rimraf = require('rimraf');
127127

128128
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
129129
module.exports = async function () {
130130
// close the browser instance
131131
await global.__BROWSER_GLOBAL__.close();
132132

133133
// clean-up the wsEndpoint file
134-
rimraf.sync(DIR);
134+
await fs.rm(DIR, {recursive: true, force: true});
135135
};
136136
```
137137

website/versioned_docs/version-27.1/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ Finally, we can close the puppeteer instance and clean-up the file
121121

122122
```js
123123
// teardown.js
124+
const fs = require('fs').promises;
124125
const os = require('os');
125126
const path = require('path');
126-
const rimraf = require('rimraf');
127127

128128
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
129129
module.exports = async function () {
130130
// close the browser instance
131131
await global.__BROWSER_GLOBAL__.close();
132132

133133
// clean-up the wsEndpoint file
134-
rimraf.sync(DIR);
134+
await fs.rm(DIR, {recursive: true, force: true});
135135
};
136136
```
137137

website/versioned_docs/version-27.2/Puppeteer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ Finally, we can close the puppeteer instance and clean-up the file
121121

122122
```js
123123
// teardown.js
124+
const fs = require('fs').promises;
124125
const os = require('os');
125126
const path = require('path');
126-
const rimraf = require('rimraf');
127127

128128
const DIR = path.join(os.tmpdir(), 'jest_puppeteer_global_setup');
129129
module.exports = async function () {
130130
// close the browser instance
131131
await global.__BROWSER_GLOBAL__.close();
132132

133133
// clean-up the wsEndpoint file
134-
rimraf.sync(DIR);
134+
await fs.rm(DIR, {recursive: true, force: true});
135135
};
136136
```
137137

0 commit comments

Comments
 (0)