Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brianzchen committed Mar 17, 2024
1 parent 23ce6ae commit a8c67d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/commands/__tests__/runTests-test.js
Expand Up @@ -12,7 +12,7 @@ const runTest = async (mockConsole: boolean) => {
path: path.join(__dirname, '__runTests-fixtures__'),
};
return await run(args);
}
};

describe('run-tests (command)', () => {
describe('regression 1385', () => {
Expand Down
10 changes: 9 additions & 1 deletion cli/src/commands/runTests.js
@@ -1,4 +1,5 @@
// @flow
import fileSys from 'fs';

import {child_process, fs, os, path} from '../lib/node.js';
import {copyFile, recursiveRmdir} from '../lib/fileUtils.js';
Expand Down Expand Up @@ -489,7 +490,14 @@ async function removeTrashFromBinDir() {
(await fs.readdir(path.join(BIN_DIR)))
.filter(name => !checkFlowFilename(name))
.forEach(async el => {
await fs.unlink(path.resolve(BIN_DIR, el));
const dir = path.resolve(BIN_DIR, el);
if (fs.exists(dir)) {
if (fileSys.lstatSync(dir).isDirectory()) {
fs.rm(dir, {recursive: true});
} else {
await fs.unlink(dir);
}
}
});
}

Expand Down

0 comments on commit a8c67d7

Please sign in to comment.