From 80e2bd66f54bca88a749d40784828d29bae8995f Mon Sep 17 00:00:00 2001 From: Jacob Scearcy Date: Mon, 6 May 2024 06:42:35 -0700 Subject: =?UTF-8?q?=F0=9F=94=80=20Use=20vitest=20for=20runtime/vdom=20test?= =?UTF-8?q?ing.=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🧪 move tests into test directory, bump birdie to ignore non-gleam files * implement feedback * add comments, update doc --- test/vdom.ffi.bench.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/vdom.ffi.bench.js (limited to 'test/vdom.ffi.bench.js') diff --git a/test/vdom.ffi.bench.js b/test/vdom.ffi.bench.js new file mode 100644 index 0000000..a8e139e --- /dev/null +++ b/test/vdom.ffi.bench.js @@ -0,0 +1,27 @@ +import { bench, describe } from "vitest"; +import { setupDOM } from "./utils"; +import { morph } from "../src/vdom.ffi.mjs"; +import { smoke_test } from "../test-apps/vdom-test-templates/build/dev/javascript/app/client_test.mjs"; + +// BENCH ------------------------------------------------------------------------ + +describe("vdom morph bench", () => { + let appEl; + let template; + bench( + "smoke test morph", + () => { + appEl = morph(appEl, template); + }, + { + setup: () => { + const result = setupDOM(); + + global.Node = result.Node; + global.document = result.document; + appEl = document.getElementById("app"); + template = smoke_test(); + } + } + ); +}); -- cgit v1.2.3