Skip to content

Commit

Permalink
Fix Zui Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskerr committed Dec 20, 2023
1 parent 98ae61c commit e0e3a7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions apps/zui/src/electron/run-main/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function boot(args: Partial<MainArgs> = {}) {
// 6. Protocol Handler
runProtocolHandlers()
// 7. Start the app
app.whenReady().then(() => main.start())

await app.whenReady()
await main.start()
return main
}
8 changes: 0 additions & 8 deletions apps/zui/src/electron/start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ jest.mock("@brimdata/zed-node")

afterEach(teardown)

test("start is called in zed lake", async () => {
const appMain = (await main({
devtools: false,
autoUpdater: false,
})) as MainObject
expect(appMain.lake.start).toHaveBeenCalledTimes(1)
})

test("app opens a window on startup", async () => {
const appMain = (await main({
devtools: false,
Expand Down
1 change: 1 addition & 0 deletions apps/zui/src/test/system/boot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function boot(name: string, args: Partial<BootArgs> = {}) {
autoUpdater: false,
singleInstance: false,
})) as MainObject

await waitFor(async () => fetch(`http://localhost:${lakePort}/version`), {
timeout: 20_000,
})
Expand Down
4 changes: 2 additions & 2 deletions packages/zed-node/src/lake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Lake {
}

addr(): string {
return `:${this.port}`;
return `localhost:${this.port}`;
}

start() {
Expand All @@ -38,7 +38,7 @@ export class Lake {
const args = [
'serve',
'-l',
this.addr(),
':' + this.port,
'-lake',
this.root,
'-log.level=info',
Expand Down

0 comments on commit e0e3a7d

Please sign in to comment.