Skip to content

Commit

Permalink
add monaco-editor.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Sep 6, 2023
1 parent 24ed0ad commit 5d68986
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { describe, it, expect } from "vitest";
import { ref } from "vue";

import { withSetup } from "@/tests/test-utils";

import { useMonacoEditor } from "../monaco-editor";

describe("useMonacoEditor", () => {
it("editor is created", () => {
let result!: ReturnType<typeof useMonacoEditor>;
const element = ref(document.createElement("div"));
const source = ref("");
const app = withSetup(() => {
result = useMonacoEditor(element, source);
});
const { editor, model } = result;
expect(editor.value).toBeDefined();
app.unmount();
});
});

0 comments on commit 5d68986

Please sign in to comment.