Skip to content

Commit 02161bd

Browse files
committed
fix tests from commit suggestions
1 parent e51c2d4 commit 02161bd

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

packages/js-sdk/tests/sandbox/connect.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { assert, test } from 'vitest'
22

3-
import { Sandbox } from '../../src'
4-
import { isDebug, template } from '../setup.js'
3+
import sandbox, { Sandbox } from '../../src'
4+
import { isDebug, sandboxTest, template } from '../setup.js'
55

66
test('connect', async () => {
77
const sbx = await Sandbox.create(template, { timeoutMs: 10_000 })
@@ -19,12 +19,13 @@ test('connect', async () => {
1919
}
2020
}
2121
})
22+
2223
sandboxTest('connect to non-running sandbox', async ({ sandbox }) => {
23-
const isRunning = await sbx.isRunning()
24+
const isRunning = await sandbox.isRunning()
2425
assert.isTrue(isRunning)
25-
await sbx.kill()
26+
await sandbox.kill()
2627

27-
const sbxConnection = await Sandbox.connect(sbx.sandboxId)
28+
const sbxConnection = await Sandbox.connect(sandbox.sandboxId)
2829
const isRunning2 = await sbxConnection.isRunning()
2930
assert.isFalse(isRunning2)
3031
})

packages/js-sdk/tests/sandbox/host.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ sandboxTest.skipIf(isDebug)(
4040
'ping server in non-running sandbox',
4141
async ({ sandbox }) => {
4242
const host = sandbox.getHost(3000)
43-
const url = `https://{host}`
43+
const url = `https://${host}`
4444

4545
await sandbox.kill()
4646

@@ -52,8 +52,8 @@ sandboxTest.skipIf(isDebug)(
5252
const res2 = await fetch(url)
5353
assert.equal(res2.status, 502)
5454

55-
const text = await res2.text()
56-
const json = JSON.parse(text) as {
55+
const text2 = await res2.text()
56+
const json = JSON.parse(text2) as {
5757
message: string
5858
sandboxId: string
5959
code: number

0 commit comments

Comments
 (0)