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 = {
|
||||
prepare
|
||||
}
|
|
@ -1,29 +1,27 @@
|
|||
import { test } from "vitest";
|
||||
import { test, expect, vi } from "vitest";
|
||||
import { exportedForTest } from "../commands/prepare.mjs";
|
||||
import { vi } from "vitest";
|
||||
import consola from "consola";
|
||||
import { expect } from "vitest";
|
||||
import { execSync } from "node:child_process";
|
||||
|
||||
const testFn = exportedForTest.prepare;
|
||||
|
||||
test('start prepare script', () => {
|
||||
const spy = vi.spyOn(consola, 'start');
|
||||
test("start prepare script", () => {
|
||||
const spy = vi.spyOn(consola, "start");
|
||||
|
||||
testFn();
|
||||
|
||||
expect(spy).toHaveBeenCalled()
|
||||
})
|
||||
expect(spy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('execute nitropack prepare', () => {
|
||||
const command = 'npx nitropack prepare';
|
||||
const param = {stdio: 'inherit'};
|
||||
vi.mock('node:child_process');
|
||||
test("execute nitropack prepare", () => {
|
||||
const command = "npx nitropack prepare";
|
||||
const param = { stdio: "inherit" };
|
||||
vi.mock("node:child_process");
|
||||
|
||||
testFn();
|
||||
|
||||
expect(execSync).toHaveBeenCalled();
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* TODO:
|
||||
|
|
Loading…
Reference in a new issue