-
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.
fix: missing symlinks in macos (#990)
- Loading branch information
1 parent
eb7906a
commit 8ab84ea
Showing
8 changed files
with
105 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
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,17 @@ | ||
import get from "../src/get.js"; | ||
|
||
// TODO: fix get function and move this into a before hook | ||
// Running this inside a before hook makes the test suite fail. | ||
// There is likely some asyncronous behaviour that is not being handled properly. | ||
// This allows the test suite to pass. | ||
await get({ | ||
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, | ||
}); |
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,42 @@ | ||
import assert from "node:assert"; | ||
import fs from "node:fs"; | ||
import fsm from "node:fs/promises"; | ||
import path from "node:path"; | ||
import process from "node:process"; | ||
import { describe, it } from "node:test"; | ||
|
||
describe("get", 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, | ||
}; | ||
|
||
it("downloads macos binary", async function () { | ||
assert.strictEqual(fs.existsSync(path.resolve(process.cwd(), options.cacheDir, `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform}-${options.arch}`, "nwjs.app")), true); | ||
}); | ||
|
||
it("preserves symlinks on macos build", async function () { | ||
// await get({...options}) | ||
const frameworksPath = path.resolve(process.cwd(), options.cacheDir, `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform}-${options.arch}`, "nwjs.app", "Contents", "Frameworks", "nwjs Framework.framework"); | ||
const symlinks = [ | ||
path.join(frameworksPath, "Helpers"), | ||
path.join(frameworksPath, "Libraries"), | ||
path.join(frameworksPath, "nwjs Framework"), | ||
path.join(frameworksPath, "Resources"), | ||
path.join(frameworksPath, "Versions", "Current"), | ||
]; | ||
|
||
for (const symlink of symlinks) { | ||
const stats = await fsm.lstat(symlink); | ||
assert.strictEqual(stats.isSymbolicLink(), true); | ||
} | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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