-
Notifications
You must be signed in to change notification settings - Fork 208
Expand file tree
/
Copy pathdefaultKernels.test.ts
More file actions
32 lines (27 loc) · 975 Bytes
/
defaultKernels.test.ts
File metadata and controls
32 lines (27 loc) · 975 Bytes
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
import { expect } from 'vitest'
import { sandboxTest } from './setup'
sandboxTest('test js kernel', async ({ sandbox }) => {
const output = await sandbox.runCode('console.log("Hello World!")', {
language: 'js',
})
expect(output.logs.stdout).toEqual(['Hello World!\n'])
})
sandboxTest('test ts kernel', async ({ sandbox }) => {
const output = await sandbox.runCode(
'const message: string = "Hello World!"; console.log(message)',
{ language: 'ts' }
)
expect(output.logs.stdout).toEqual(['Hello World!\n'])
})
sandboxTest('test ts kernel errors', async ({ sandbox }) => {
const output = await sandbox.runCode('import x from "module";', {
language: 'typescript',
})
expect(output.error?.name).toEqual('TypeScriptCompilerError')
})
sandboxTest('test ruby kernel', async ({ sandbox }) => {
const output = await sandbox.runCode('puts "Hello World!"', {
language: 'ruby',
})
expect(output.logs.stdout).toEqual(['Hello World!\n'])
})