|
1 |
| -import { chmod, rmdir, mkdir, symlink, readdir, readFile, writeFile } from 'node:fs/promises'; |
| 1 | +import { chmod, rm, mkdir, symlink, readdir, readFile, writeFile } from 'node:fs/promises'; |
2 | 2 | import sysPath from 'node:path';
|
3 | 3 | import { fileURLToPath } from 'node:url';
|
4 | 4 | import { Readable } from 'node:stream';
|
@@ -52,15 +52,15 @@ async function beforeEach() {
|
52 | 52 | const i = testCount.toString();
|
53 | 53 | currPath = sysPath.join(root, i);
|
54 | 54 | try {
|
55 |
| - await rmdir(currPath, { recursive: true }); |
| 55 | + await rm(currPath, { recursive: true }); |
56 | 56 | } catch (e) {}
|
57 | 57 | await mkdir(currPath, { recursive: true });
|
58 | 58 | return true;
|
59 | 59 | }
|
60 | 60 |
|
61 | 61 | let afterEach = async () => {
|
62 | 62 | // await pRimraf(currPath);
|
63 |
| - await rmdir(currPath, { recursive: true }); |
| 63 | + await rm(currPath, { recursive: true }); |
64 | 64 | };
|
65 | 65 |
|
66 | 66 | describe('readdirp', () => {
|
@@ -349,7 +349,7 @@ describe('readdirp', () => {
|
349 | 349 | isWarningCalled = true;
|
350 | 350 | });
|
351 | 351 | await delay(1000);
|
352 |
| - await rmdir(sysPath.join(currPath, 'a'), { recursive: true }); |
| 352 | + await rm(sysPath.join(currPath, 'a'), { recursive: true }); |
353 | 353 | stream.resume();
|
354 | 354 | await Promise.race([waitForEnd(stream), delay(2000)]);
|
355 | 355 | isWarningCalled.should.equals(true);
|
@@ -412,7 +412,7 @@ describe('readdirp', () => {
|
412 | 412 | await mkdir(root, { recursive: true });
|
413 | 413 | // Declare last task here
|
414 | 414 | it('clean-up', async () => {
|
415 |
| - await rmdir(root, { recursive: true, force: true }); |
| 415 | + await rm(root, { recursive: true, force: true }); |
416 | 416 | });
|
417 |
| - it.run(); |
| 417 | + it.run(true); |
418 | 418 | })();
|
0 commit comments