-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathcontexts.test.ts
More file actions
40 lines (29 loc) · 1.08 KB
/
contexts.test.ts
File metadata and controls
40 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { expect } from 'vitest'
import { isDebug, sandboxTest } from './setup'
sandboxTest('create context with no options', async ({ sandbox }) => {
const context = await sandbox.createCodeContext()
expect(context.id).toBeDefined()
expect(context.language).toBe('python')
expect(context.cwd).toBe('/home/user')
})
sandboxTest('create context with options', async ({ sandbox }) => {
const context = await sandbox.createCodeContext({
language: 'python',
cwd: '/home/user/test',
})
expect(context.id).toBeDefined()
expect(context.language).toBe('python')
expect(context.cwd).toBe('/home/user/test')
})
sandboxTest('remove context', async ({ sandbox }) => {
const context = await sandbox.createCodeContext()
await sandbox.removeCodeContext(context.id)
})
sandboxTest('list contexts', async ({ sandbox }) => {
const contexts = await sandbox.listCodeContexts()
expect(contexts.length).toBeGreaterThan(0)
})
sandboxTest('restart context', async ({ sandbox }) => {
const context = await sandbox.createCodeContext()
await sandbox.restartCodeContext(context.id)
})