Skip to content

Commit 4e0c266

Browse files
Fix test
1 parent 3a8840f commit 4e0c266

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/firebase_studio/migrate.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ describe("migrate", () => {
5656
let commandStub: sinon.SinonStub;
5757
let trackStub: sinon.SinonStub;
5858
let confirmStub: sinon.SinonStub;
59+
let inputStub: sinon.SinonStub;
60+
let spawnStub: sinon.SinonStub;
5961

6062
beforeEach(() => {
6163
sandbox.stub(fs, "stat").resolves({ isDirectory: () => true } as any);
@@ -108,6 +110,14 @@ describe("migrate", () => {
108110
commandStub = sandbox.stub(utils, "commandExistsSync").returns(false);
109111
trackStub = sandbox.stub(track, "trackGA4").resolves();
110112
confirmStub = sandbox.stub(prompt, "confirm").resolves(false);
113+
inputStub = sandbox.stub(prompt, "input").resolves("studio");
114+
115+
const childProcess = require("child_process");
116+
spawnStub = sandbox.stub(childProcess, "spawn").returns({
117+
unref: () => {
118+
// No-op for testing
119+
},
120+
} as unknown as import("child_process").ChildProcess);
111121
});
112122

113123
it("should fail if the directory does not exist", async () => {
@@ -126,13 +136,6 @@ describe("migrate", () => {
126136
throw Object.assign(new Error("ENOENT"), { code: "ENOENT" });
127137
});
128138

129-
const childProcess = require("child_process");
130-
const spawnStub = sandbox.stub(childProcess, "spawn").returns({
131-
unref: () => {
132-
// No-op for testing
133-
},
134-
} as unknown as import("child_process").ChildProcess);
135-
136139
confirmStub.resolves(true);
137140

138141
await migrate(testRoot);

0 commit comments

Comments
 (0)