diff --git a/package.json b/package.json index 8c118587d..bea508e9f 100644 --- a/package.json +++ b/package.json @@ -42,13 +42,13 @@ }, "scripts": { "postinstall": "node ./src/postinstall.js", - "lint": "eslint ./src/**/*.js ./test/**/*.js", - "lint:fix": "eslint --fix ./src/**/*.js ./test/**/*.js", + "lint": "eslint ./src/**/*.js ./tests/**/*.js", + "lint:fix": "eslint --fix ./src/**/*.js ./tests/**/*.js", "markdown:fix": "markdownlint --fix ./README.md", "docs": "jsdoc -d docs ./README.md ./src/index.js ./src/get.js ./src/run.js ./src/bld.js", "test": "vitest run --coverage", "test:cov": "vitest --coverage.enabled true", - "demo": "cd test/fixtures && node demo.js", + "demo": "cd tests/fixtures && node demo.js", "license-check": "jsgl --local ." }, "devDependencies": { diff --git a/test/fixtures/app/icon.icns b/tests/fixtures/app/icon.icns similarity index 100% rename from test/fixtures/app/icon.icns rename to tests/fixtures/app/icon.icns diff --git a/test/fixtures/app/icon.ico b/tests/fixtures/app/icon.ico similarity index 100% rename from test/fixtures/app/icon.ico rename to tests/fixtures/app/icon.ico diff --git a/test/fixtures/app/icon.png b/tests/fixtures/app/icon.png similarity index 100% rename from test/fixtures/app/icon.png rename to tests/fixtures/app/icon.png diff --git a/test/fixtures/app/index.html b/tests/fixtures/app/index.html similarity index 100% rename from test/fixtures/app/index.html rename to tests/fixtures/app/index.html diff --git a/test/fixtures/app/package.json b/tests/fixtures/app/package.json similarity index 100% rename from test/fixtures/app/package.json rename to tests/fixtures/app/package.json diff --git a/test/fixtures/demo.js b/tests/fixtures/demo.js similarity index 100% rename from test/fixtures/demo.js rename to tests/fixtures/demo.js diff --git a/src/get/decompress.test.js b/tests/specs/decompress.test.js similarity index 92% rename from src/get/decompress.test.js rename to tests/specs/decompress.test.js index 9eabe1881..062f6659c 100644 --- a/src/get/decompress.test.js +++ b/tests/specs/decompress.test.js @@ -5,15 +5,15 @@ import process from "node:process"; import * as nw from "nw"; import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest"; -import decompress from "./decompress.js"; +import decompress from "../../src/get/decompress.js"; -import util from '../util.js'; +import util from '../../src/util.js'; describe("get/decompress", async function () { let nwFilePath = ''; let nwDirPath = ''; - let nwOutPath = "./test/fixtures/cache"; + let nwOutPath = "./tests/fixtures/cache"; afterAll(async function () { await fs.promises.rm(nwOutPath, { recursive: true, force: true }); diff --git a/src/get/ffmpeg.test.js b/tests/specs/ffmpeg.test.js similarity index 86% rename from src/get/ffmpeg.test.js rename to tests/specs/ffmpeg.test.js index 115b05ac8..4cd3f3fd2 100644 --- a/src/get/ffmpeg.test.js +++ b/tests/specs/ffmpeg.test.js @@ -3,9 +3,9 @@ import process from "node:process"; import { afterEach, describe, expect, it } from "vitest"; -import util from "../util.js"; +import util from "../../src/util.js"; -import ffmpeg from "./ffmpeg.js"; +import ffmpeg from "../../src/get/ffmpeg.js"; describe("get/ffmpeg", function () { @@ -21,7 +21,7 @@ describe("get/ffmpeg", function () { "0.83.0", util.PLATFORM_KV[process.platform], util.ARCH_KV[process.arch], - "./test/fixtures" + "./tests/fixtures" ); expect(util.fileExists(ffmpegFile)).resolves.toBe(true); }, Infinity); diff --git a/src/get/node.test.js b/tests/specs/node.test.js similarity index 81% rename from src/get/node.test.js rename to tests/specs/node.test.js index 82df3bba3..423c3e588 100644 --- a/src/get/node.test.js +++ b/tests/specs/node.test.js @@ -2,9 +2,9 @@ import fs from "node:fs"; import { afterEach, describe, expect, it } from "vitest"; -import util from "../util.js"; +import util from "../../src/util.js"; -import node from "./node.js"; +import node from "../../src/get/node.js"; describe("get/node", function () { @@ -18,7 +18,7 @@ describe("get/node", function () { nodeFile = await node( "https://dl.nwjs.io", "0.83.0", - "./test/fixtures" + "./tests/fixtures" ); expect(util.fileExists(nodeFile)).resolves.toBe(true); }, Infinity); diff --git a/src/get/nw.test.js b/tests/specs/nw.test.js similarity index 85% rename from src/get/nw.test.js rename to tests/specs/nw.test.js index a8806449d..d43f63485 100644 --- a/src/get/nw.test.js +++ b/tests/specs/nw.test.js @@ -3,9 +3,9 @@ import process from "node:process"; import { afterEach, describe, expect, it } from "vitest"; -import util from "../util.js"; +import util from "../../src/util.js"; -import nw from "./nw.js"; +import nw from "../../src/get/nw.js"; describe("get/nw", function () { @@ -22,7 +22,7 @@ describe("get/nw", function () { "sdk", util.PLATFORM_KV[process.platform], util.ARCH_KV[process.arch], - "./test/fixtures" + "./tests/fixtures" ); expect(util.fileExists(nwFile)).resolves.toBe(true); }, Infinity); diff --git a/src/get/request.test.js b/tests/specs/request.test.js similarity index 70% rename from src/get/request.test.js rename to tests/specs/request.test.js index dd9686347..bd28eaa7e 100644 --- a/src/get/request.test.js +++ b/tests/specs/request.test.js @@ -1,13 +1,13 @@ import { describe, expect, it } from "vitest"; -import util from "../util.js"; +import util from "../../src/util.js"; -import request from "./request.js"; +import request from "../../src/get/request.js"; describe.skip("get/request", function () { let url = "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json" - const filePath = "./test/fixtures/cache/request.test.json"; + const filePath = "./tests/fixtures/cache/request.test.json"; it("downloads from specific url", async function () { await request(url, filePath); diff --git a/test/specs/bld.test.js b/tests/specs/run.test.js similarity index 93% rename from test/specs/bld.test.js rename to tests/specs/run.test.js index 3c505a81b..c53d56e75 100644 --- a/test/specs/bld.test.js +++ b/tests/specs/run.test.js @@ -15,7 +15,7 @@ describe.skip("build test suite", async () => { let driver = undefined; const nwOptions = { - srcDir: "test/fixtures/app", + srcDir: "tests/fixtures/app", mode: "build", version: "0.83.0", flavor: "sdk", @@ -23,8 +23,8 @@ describe.skip("build test suite", async () => { arch: util.ARCH_KV[process.arch], downloadUrl: "https://dl.nwjs.io", manifestUrl: "https://nwjs.io/versions", - outDir: "test/fixtures/out/app", - cacheDir: "test/fixtures/cache", + outDir: "tests/fixtures/out/app", + cacheDir: "tests/fixtures/cache", cache: true, ffmpeg: false, glob: false, diff --git a/src/get/verify.test.js b/tests/specs/verify.test.js similarity index 88% rename from src/get/verify.test.js rename to tests/specs/verify.test.js index 24539b06d..c1ba218af 100644 --- a/src/get/verify.test.js +++ b/tests/specs/verify.test.js @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import verify from "./verify.js"; +import verify from "../../src/get/verify.js"; describe("get/verify", function () {