chore(cli): clean imports
This commit is contained in:
parent
09cd38a481
commit
6c7877b049
2 changed files with 12 additions and 15 deletions
|
@ -33,7 +33,6 @@ export default defineCommand({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export const exportedForTest = {
|
export const exportedForTest = {
|
||||||
prepare
|
prepare
|
||||||
}
|
}
|
|
@ -1,29 +1,27 @@
|
||||||
import { test } from "vitest";
|
import { test, expect, vi } from "vitest";
|
||||||
import { exportedForTest } from "../commands/prepare.mjs";
|
import { exportedForTest } from "../commands/prepare.mjs";
|
||||||
import { vi } from "vitest";
|
|
||||||
import consola from "consola";
|
import consola from "consola";
|
||||||
import { expect } from "vitest";
|
import { execSync } from "node:child_process";
|
||||||
import {execSync} from "node:child_process";
|
|
||||||
|
|
||||||
const testFn = exportedForTest.prepare;
|
const testFn = exportedForTest.prepare;
|
||||||
|
|
||||||
test('start prepare script', () => {
|
test("start prepare script", () => {
|
||||||
const spy = vi.spyOn(consola, 'start');
|
const spy = vi.spyOn(consola, "start");
|
||||||
|
|
||||||
testFn();
|
testFn();
|
||||||
|
|
||||||
expect(spy).toHaveBeenCalled()
|
expect(spy).toHaveBeenCalled();
|
||||||
})
|
});
|
||||||
|
|
||||||
test('execute nitropack prepare', () => {
|
test("execute nitropack prepare", () => {
|
||||||
const command = 'npx nitropack prepare';
|
const command = "npx nitropack prepare";
|
||||||
const param = {stdio: 'inherit'};
|
const param = { stdio: "inherit" };
|
||||||
vi.mock('node:child_process');
|
vi.mock("node:child_process");
|
||||||
|
|
||||||
testFn();
|
testFn();
|
||||||
|
|
||||||
expect(execSync).toHaveBeenCalled();
|
expect(execSync).toHaveBeenCalled();
|
||||||
})
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO:
|
* TODO:
|
||||||
|
|
Loading…
Reference in a new issue