We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 141679f commit 70cac33Copy full SHA for 70cac33
test/lang-clojure-eval.test.js
@@ -1,21 +1,8 @@
1
import { assert, expect, test } from 'vitest'
2
+import {EditorState} from "@codemirror/state"
3
+import { evalString, sciInit } from "../src/sci"
4
-// Edit an assertion and save to see HMR in action
-
5
-test('Math.sqrt()', () => {
6
- expect(Math.sqrt(4)).toBe(2)
7
- expect(Math.sqrt(144)).toBe(12)
8
- expect(Math.sqrt(2)).toBe(Math.SQRT2)
+test('evalString()', () => {
+ let ctx = sciInit()
+ expect(evalString(ctx, "(+ 1 2 3)")).toBe("6")
9
})
10
11
-test('JSON', () => {
12
- const input = {
13
- foo: 'hello',
14
- bar: 'world',
15
- }
16
17
- const output = JSON.stringify(input)
18
19
- expect(output).eq('{"foo":"hello","bar":"world"}')
20
- assert.deepEqual(JSON.parse(output), input, 'matches original')
21
-})
0 commit comments