Skip to content

Commit bd3fabb

Browse files
chore(test): move tests to seperate directory (#206)
1 parent c8e6571 commit bd3fabb

10 files changed

+21
-21
lines changed
File renamed without changes.
File renamed without changes.

src/decompress.test.js tests/specs/decompress.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import process from "node:process";
44

55
import { afterAll, beforeAll, describe, expect, it } from "vitest";
66

7-
import * as nw from "../src/index.js";
8-
import decompress from "./decompress.js";
9-
import util from './util.js';
7+
import * as nw from "../../src/index.js";
8+
import decompress from "../../src/decompress.js";
9+
import util from '../../src/util.js';
1010

1111
describe("get/decompress", async function () {
1212

1313
let nwFilePath = '';
1414
let nwDirPath = '';
15-
let nwOutPath = "./test/fixture/cache";
15+
let nwOutPath = "./tests/fixtures/cache";
1616

1717
afterAll(async function () {
1818
await fs.promises.rm(nwOutPath, { recursive: true, force: true });

src/ffmpeg.test.js tests/specs/ffmpeg.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import process from "node:process";
33

44
import { afterEach, beforeAll, describe, expect, it } from "vitest";
55

6-
import ffmpeg from "./ffmpeg.js";
7-
import util from "./util.js";
6+
import ffmpeg from "../../src/ffmpeg.js";
7+
import util from "../../src/util.js";
88

99
describe("get/ffmpeg", function () {
1010

@@ -15,7 +15,7 @@ describe("get/ffmpeg", function () {
1515
});
1616

1717
beforeAll(async function () {
18-
await fs.promises.mkdir("./test/fixture", { recursive: true });
18+
await fs.promises.mkdir("./tests/fixture", { recursive: true });
1919
});
2020

2121
it("downloades community prebuild FFmpeg for specifc platform", async function () {
@@ -24,7 +24,7 @@ describe("get/ffmpeg", function () {
2424
"0.83.0",
2525
util.PLATFORM_KV[process.platform],
2626
util.ARCH_KV[process.arch],
27-
"./test/fixture"
27+
"./tests/fixtures"
2828
);
2929
expect(util.fileExists(ffmpegFile)).resolves.toBe(true);
3030
}, Infinity);

src/node.test.js tests/specs/node.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import fs from "node:fs";
22

33
import { afterEach, describe, expect, it } from "vitest";
44

5-
import node from "./node.js";
6-
import util from "./util.js";
5+
import node from "../../src/node.js";
6+
import util from "../../src/util.js";
77

88
describe("get/node", function () {
99

@@ -17,7 +17,7 @@ describe("get/node", function () {
1717
nodeFile = await node(
1818
"https://dl.nwjs.io",
1919
"0.83.0",
20-
"./test/fixture"
20+
"./tests/fixtures"
2121
);
2222
expect(util.fileExists(nodeFile)).resolves.toBe(true);
2323
}, Infinity);

src/nw.test.js tests/specs/nw.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import process from "node:process";
33

44
import { afterEach, describe, expect, it } from "vitest";
55

6-
import nw from "./nw.js";
7-
import util from "./util.js";
6+
import nw from "../../src/nw.js";
7+
import util from "../../src/util.js";
88

99
describe("get/nw", function () {
1010

@@ -21,7 +21,7 @@ describe("get/nw", function () {
2121
"sdk",
2222
util.PLATFORM_KV[process.platform],
2323
util.ARCH_KV[process.arch],
24-
"./test/fixture"
24+
"./tests/fixtures"
2525
);
2626
expect(util.fileExists(nwFile)).resolves.toBe(true);
2727
}, Infinity);

src/request.test.js tests/specs/request.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { describe, expect, it } from "vitest";
22

3-
import request from "./request.js";
4-
import util from "./util.js";
3+
import request from "../../src/request.js";
4+
import util from "../../src/util.js";
55

66
describe.skip("get/request", function () {
77

88
let url = "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json"
9-
const filePath = "./test/fixture/cache/request.test.json";
9+
const filePath = "./tests/fixtures/cache/request.test.json";
1010

1111
it("downloads from specific url", async function () {
1212
await request(url, filePath);

test/selenium.test.js tests/specs/run.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import selenium from "selenium-webdriver";
44
import chrome from "selenium-webdriver/chrome.js";
55
import { afterAll, beforeAll, describe, expect, it } from "vitest";
66

7-
import util from "../src/util.js";
7+
import util from "../../src/util.js";
88

99
describe("run", async function () {
1010
/**
@@ -15,7 +15,7 @@ describe("run", async function () {
1515
beforeAll(async function () {
1616
const options = new chrome.Options();
1717
const seleniumArgs = [
18-
`--nwapp=${path.resolve("test", "fixture" , "app")}`,
18+
`--nwapp=${path.resolve("tests", "fixtures" , "app")}`,
1919
"--headless=new",
2020
];
2121

test/findpath.test.js tests/specs/util.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test } from 'vitest';
22

3-
import util from '../src/util.js';
3+
import util from '../../src/util.js';
44

55
test('nwjs has downloaded and been extracted', async function () {
66
const path = await util.findpath('nwjs', { flavor: 'sdk' });

src/verify.test.js tests/specs/verify.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "vitest";
22

3-
import verify from "./verify.js";
3+
import verify from "../../src/verify.js";
44

55
describe("get/verify", function () {
66

0 commit comments

Comments
 (0)