-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: verify symlinks are created for macos build
- Loading branch information
1 parent
593483d
commit 6ff678c
Showing
3 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import assert from "node:assert"; | ||
import fsm from "node:fs/promises"; | ||
import path from "node:path"; | ||
|
||
import { describe, it } from "node:test"; | ||
|
||
import get from "../src/get.js"; | ||
|
||
describe("get mode", function () { | ||
it("decompresses file and preserves symlinks on macos", async () => { | ||
const options = { | ||
version: "0.82.0", | ||
flavor: "sdk", | ||
platform: "osx", | ||
arch: "x64", | ||
downloadUrl: "https://dl.nwjs.io", | ||
cacheDir: "./test/fixture/cache", | ||
cache: true, | ||
ffmpeg: false, | ||
nativeAddon: false, | ||
}; | ||
|
||
await get(options); | ||
|
||
const nwDir = path.resolve( | ||
options.cacheDir, | ||
`nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform}-${options.arch}`, | ||
); | ||
|
||
const helpersPath = await fsm.stat( | ||
path.resolve( | ||
nwDir, | ||
"nwjs.app", | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"Helpers" | ||
) | ||
); | ||
const librariesPath = await fsm.stat( | ||
path.resolve( | ||
nwDir, | ||
"nwjs.app", | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"Libraries" | ||
) | ||
); | ||
const frameworkPath = await fsm.stat( | ||
path.resolve( | ||
nwDir, | ||
"nwjs.app", | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"nwjs Framework" | ||
) | ||
); | ||
const resourcesPath = await fsm.stat( | ||
path.resolve( | ||
nwDir, | ||
"nwjs.app", | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"Resources" | ||
) | ||
); | ||
const versionCurrentPath = await fsm.stat( | ||
path.resolve( | ||
nwDir, | ||
"nwjs.app", | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"Versions", | ||
"Current" | ||
) | ||
); | ||
|
||
assert.strictEqual(helpersPath.isSymbolicLink(), true); | ||
assert.strictEqual(librariesPath.isSymbolicLink(), true); | ||
assert.strictEqual(frameworkPath.isSymbolicLink(), true); | ||
assert.strictEqual(resourcesPath.isSymbolicLink(), true); | ||
assert.strictEqual(versionCurrentPath.isSymbolicLink(), true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// import * as addonTests from "./addon.js"; | ||
import * as modeTests from "./mode.js"; | ||
import * as getTests from "./get.js"; | ||
// import * as modeTests from "./mode.js"; | ||
|
||
// addonTests; | ||
modeTests; | ||
getTests; | ||
// modeTests; |