Skip to content

Commit

Permalink
chore(test): move tests to seperate dir (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra authored Aug 18, 2024
1 parent c6193bb commit da0e353
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/get/decompress.test.js → tests/specs/decompress.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
6 changes: 3 additions & 3 deletions src/get/ffmpeg.test.js → tests/specs/ffmpeg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {

Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/get/node.test.js → tests/specs/node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {

Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/get/nw.test.js → tests/specs/nw.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {

Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/get/request.test.js → tests/specs/request.test.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
6 changes: 3 additions & 3 deletions test/specs/bld.test.js → tests/specs/run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ 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",
platform: util.PLATFORM_KV[process.platform],
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,
Expand Down
2 changes: 1 addition & 1 deletion src/get/verify.test.js → tests/specs/verify.test.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down

0 comments on commit da0e353

Please sign in to comment.