Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Nov 18, 2024
2 parents 4e8a62f + 117d1b5 commit 4643aae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
18 changes: 16 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"<!(node -p \"require('node-addon-api').gyp\")"
],
"defines": [
"NAPI_DISABLE_CPP_EXCEPTIONS"
"NAPI_CPP_EXCEPTIONS"
],
"conditions": [
[
Expand Down Expand Up @@ -78,6 +78,20 @@
"sources": [
"src/darwin/fs_meta.cpp"
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"CLANG_CXX_LIBRARY": "libc++",
"MACOSX_DEPLOYMENT_TARGET": "10.15"
},
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"cflags": [
"-fexceptions",
"-fPIC"
],
"cflags_cc": [
"-fexceptions"
],
"link_settings": {
"libraries": [
"DiskArbitration.framework",
Expand All @@ -90,4 +104,4 @@
]
}
]
}
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"clean": "run-p clean:*",
"clean:dist": "rm -rf dist build",
"clean:gyp": "node-gyp clean",
"prebuild": "npm run clean",
"build": "run-p build:*",
"prebuild:gyp": "node scripts/configure.js",
"build:gyp": "node-gyp rebuild",
Expand All @@ -40,7 +39,7 @@
"test": "run-s test:*",
"test:jest": "jest",
"test:memory": "cross-env TEST_MEMORY=1 node --expose-gc node_modules/jest/bin/jest.js src/__tests__/memory.test.ts",
"it": "run-s fmt lint build test",
"it": "run-s clean fmt lint build test",
"lint": "eslint",
"lint:fix": "eslint --fix",
"fmt": "run-p fmt:*",
Expand Down
14 changes: 8 additions & 6 deletions src/__tests__/fs_metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ describe("Filesystem Metadata", () => {
afterEach(() => {
delete process.env.TEST_DELAY;
});
it("should throw TimeoutError if timeoutMs=1", async () => {
const rootPath = isWindows ? "C:\\" : "/";
await expect(getVolumeMountPoints({ timeoutMs: 1 })).rejects.toThrow(
const rootPath = isWindows ? "C:\\" : "/";
it("should handle getVolumeMountPoints() timeout", async () => {
expect(getVolumeMountPoints({ timeoutMs: 1 })).rejects.toThrow(
TimeoutError,
);
});
it("should handle getVolumeMetadata() timeout", async () => {
expect(getVolumeMetadata(rootPath, { timeoutMs: 1 })).rejects.toThrow(
TimeoutError,
);
await expect(
getVolumeMetadata(rootPath, { timeoutMs: 1 }),
).rejects.toThrow(TimeoutError);
});
});

Expand Down

0 comments on commit 4643aae

Please sign in to comment.