Skip to content

Commit

Permalink
Skip deno tests for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Nov 15, 2024
1 parent d20d0c5 commit e42f1dc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
40 changes: 20 additions & 20 deletions js/tests/languages/deno.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,65 @@ import { expect } from 'vitest'

import { sandboxTest } from '../setup'

sandboxTest('js simple', async ({ sandbox }) => {
const result = await sandbox.runCode('console.log("Hello, World!")', {language: "deno"})
sandboxTest.skip('js simple', async ({ sandbox }) => {
const result = await sandbox.runCode('console.log("Hello, World!")', { language: "deno" })

expect(result.logs.stdout.join().trim()).toEqual('Hello, World!')
})

sandboxTest('js import', async ({ sandbox }) => {
const result = await sandbox.runCode('import isOdd from "npm:is-odd"\nisOdd(3)', {language: "deno"})
sandboxTest.skip('js import', async ({ sandbox }) => {
const result = await sandbox.runCode('import isOdd from "npm:is-odd"\nisOdd(3)', { language: "deno" })

expect(result.results[0].text).toEqual('true')
})

sandboxTest('js top level await', async ({ sandbox }) => {
sandboxTest.skip('js top level await', async ({ sandbox }) => {
const result = await sandbox.runCode(`
async function main() {
return 'Hello, World!'
}
await main()
`, {language: "deno"})
`, { language: "deno" })
expect(result.results[0].text).toEqual('Hello, World!')
})

sandboxTest('js es6', async ({ sandbox }) => {
sandboxTest.skip('js es6', async ({ sandbox }) => {
const result = await sandbox.runCode(`
const add = (x, y) => x + y;
add(1, 2)`, {language: "deno"})
add(1, 2)`, { language: "deno" })
expect(result.results[0].text).toEqual('3')
})


sandboxTest('js context', async ({ sandbox }) => {
await sandbox.runCode('const z = 1', {language: "deno"})
const result = await sandbox.runCode('z', {language: "deno"})
sandboxTest.skip('js context', async ({ sandbox }) => {
await sandbox.runCode('const z = 1', { language: "deno" })
const result = await sandbox.runCode('z', { language: "deno" })
expect(result.results[0].text).toEqual('1')
})

sandboxTest('js cwd', async ({ sandbox }) => {
const result = await sandbox.runCode('process.cwd()', {language: "deno"})
sandboxTest.skip('js cwd', async ({ sandbox }) => {
const result = await sandbox.runCode('process.cwd()', { language: "deno" })
expect(result.results[0].text).toEqual('/home/user')

const ctx = await sandbox.createCodeContext( {cwd: '/home', language: "deno"})
const result2 = await sandbox.runCode('process.cwd()', {context: ctx})
const ctx = await sandbox.createCodeContext({ cwd: '/home', language: "deno" })
const result2 = await sandbox.runCode('process.cwd()', { context: ctx })
expect(result2.results[0].text).toEqual('/home')
})

sandboxTest('ts simple', async ({ sandbox }) => {
sandboxTest.skip('ts simple', async ({ sandbox }) => {
const result = await sandbox.runCode(`
function subtract(x: number, y: number): number {
return x - y;
}
subtract(1, 2)
`, {language: "deno"})
`, { language: "deno" })

expect(result.results[0].text).toEqual('-1')
})

sandboxTest('test display', async ({ sandbox }) => {
sandboxTest.skip('test display', async ({ sandbox }) => {
const result = await sandbox.runCode(`
{
[Symbol.for("Jupyter.display")]() {
Expand All @@ -73,7 +73,7 @@ sandboxTest('test display', async ({ sandbox }) => {
}
}
}
`, {language: "deno"})
`, { language: "deno" })

expect(result.results[0].html).toBe('<h1>Hello world!</h1>')
expect(result.results[0].text).toBe('Hello world!')
Expand Down
10 changes: 10 additions & 0 deletions python/tests/languages/test_deno.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import pytest

from e2b_code_interpreter import AsyncSandbox


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_javascript(async_sandbox: AsyncSandbox):
code = """
console.log('Hello, World!')
Expand All @@ -9,6 +12,7 @@ async def test_javascript(async_sandbox: AsyncSandbox):
assert execution.logs.stdout == ["Hello, World!\n"]


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_import(async_sandbox: AsyncSandbox):
code = """
import isOdd from 'npm:is-odd'
Expand All @@ -18,6 +22,7 @@ async def test_import(async_sandbox: AsyncSandbox):
assert execution.results[0].text == "true"


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_toplevel_await(async_sandbox: AsyncSandbox):
code = """
async function main() {
Expand All @@ -30,6 +35,7 @@ async def test_toplevel_await(async_sandbox: AsyncSandbox):
assert execution.results[0].text == "Hello, World!"


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_es6(async_sandbox: AsyncSandbox):
code = """
const add = (x, y) => x + y;
Expand All @@ -39,12 +45,14 @@ async def test_es6(async_sandbox: AsyncSandbox):
assert execution.results[0].text == "3"


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_context(async_sandbox: AsyncSandbox):
await async_sandbox.run_code("const x = 1", language="deno")
execution = await async_sandbox.run_code("x", language="deno")
assert execution.results[0].text == "1"


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_cwd(async_sandbox: AsyncSandbox):
execution = await async_sandbox.run_code("process.cwd()", language="deno")
assert execution.results[0].text == "/home/user"
Expand All @@ -54,6 +62,7 @@ async def test_cwd(async_sandbox: AsyncSandbox):
assert execution.results[0].text == "/home"


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_typescript(async_sandbox: AsyncSandbox):
execution = await async_sandbox.run_code(
"""
Expand All @@ -68,6 +77,7 @@ async def test_typescript(async_sandbox: AsyncSandbox):
assert execution.results[0].text == "-1"


@pytest.mark.skip(reason="Deno is not supported yet")
async def test_display(async_sandbox: AsyncSandbox):
code = """
{
Expand Down

0 comments on commit e42f1dc

Please sign in to comment.