Skip to content

Commit 2fcb2fa

Browse files
committed
fixup! Tread a failing opendir as an empty dir
1 parent 8d6c887 commit 2fcb2fa

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

packages/host/src/node/path-utils.test.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ describe("isNodeApiModule", () => {
6262
assert(isNodeApiModule(path.join(tempDirectoryPath, "addon.node")));
6363
});
6464

65-
// there is no way to set ACLs on directories in Node.js on Windows with brittle powershell commands
6665
it(
6766
"returns false when directory cannot be read due to permissions",
67+
// Skipping on Windows because there is no way to set ACLs on directories in Node.js on Windows without brittle powershell commands
6868
{ skip: process.platform === "win32" },
6969
(context) => {
7070
const tempDirectoryPath = setupTempDirectory(context, {
@@ -368,22 +368,27 @@ describe("findNodeApiModulePaths", () => {
368368
]);
369369
});
370370

371-
it("returns empty when directory cannot be read due to permissions", async (context) => {
372-
const tempDir = setupTempDirectory(context, {
373-
"addon.apple.node/react-native-node-api-module": "",
374-
});
375-
376-
removeReadPermissions(tempDir);
377-
try {
378-
const result = findNodeApiModulePaths({
379-
fromPath: tempDir,
380-
platform: "apple",
371+
it(
372+
"returns empty when directory cannot be read due to permissions",
373+
// Skipping on Windows because there is no way to set ACLs on directories in Node.js on Windows without brittle powershell commands
374+
{ skip: process.platform === "win32" },
375+
async (context) => {
376+
const tempDir = setupTempDirectory(context, {
377+
"addon.apple.node/react-native-node-api-module": "",
381378
});
382-
assert.deepEqual(await result, []);
383-
} finally {
384-
restoreReadPermissions(tempDir);
379+
380+
removeReadPermissions(tempDir);
381+
try {
382+
const result = findNodeApiModulePaths({
383+
fromPath: tempDir,
384+
platform: "apple",
385+
});
386+
assert.deepEqual(await result, []);
387+
} finally {
388+
restoreReadPermissions(tempDir);
389+
}
385390
}
386-
});
391+
);
387392
});
388393

389394
describe("determineModuleContext", () => {

0 commit comments

Comments
 (0)