Skip to content

Commit 0ad95a5

Browse files
committed
test EditorState
1 parent 07a4390 commit 0ad95a5

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

test/lang-clojure-eval.test.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
import { assert, expect, test } from 'vitest'
2-
import {EditorState} from "@codemirror/state"
1+
import { describe, expect, test, it } from 'vitest'
2+
import { EditorState } from "@codemirror/state"
33
import { evalString, sciInit } from "../src/sci"
4+
import { clojure } from "../src/clojure"
45

56
test('evalString()', () => {
67
let ctx = sciInit()
7-
expect(evalString(ctx, "(+ 1 2 3)")).toBe("6")
8+
expect(evalString(ctx, "(+ 1 2 3)")).toBe("6")
89
})
10+
11+
describe('Editor state', () => {
12+
let state = EditorState.create({
13+
doc: `(map inc (range 5))`,
14+
extensions: [clojure()]
15+
})
16+
it('Creates EditorState', () => {
17+
expect(state.doc.text[0]).eq("(map inc (range 5))")
18+
})
19+
20+
it('bar', () => {
21+
expect(1 + 1).eq(2)
22+
})
23+
})

0 commit comments

Comments
 (0)