1 | import fs from "node:fs";
|
2 | import process from "node:process";
|
3 |
|
4 | import { afterEach, describe, expect, it } from "vitest";
|
5 |
|
6 | import nw from "./nw.js";
|
7 | import util from "./util.js";
|
8 |
|
9 | describe("get/nw", function () {
|
10 |
|
11 | let nwFile = '';
|
12 |
|
13 | afterEach(function () {
|
14 | fs.promises.rm(nwFile, { recursive: true, force: true });
|
15 | });
|
16 |
|
17 | it("downloades a NW.js Linux tarball or Windows/MacOS zip", async function () {
|
18 | nwFile = await nw(
|
19 | "https://dl.nwjs.io",
|
20 | "0.83.0",
|
21 | "sdk",
|
22 | util.PLATFORM_KV[process.platform],
|
23 | util.ARCH_KV[process.arch],
|
24 | "./test/fixture"
|
25 | );
|
26 | expect(util.fileExists(nwFile)).resolves.toBe(true);
|
27 | }, Infinity);
|
28 | });
|