Skip to content

Commit

Permalink
Add simple server test
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Sep 26, 2023
1 parent 0a359eb commit ee0dd78
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/mutable/test/server.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { describe, test, expect } from "vitest";
import { createPrimitiveTemplate } from "../src/index.js";
import { createMutable } from "../src/index.js";

describe("createPrimitiveTemplate", () => {
test("doesn't break in SSR", () => {
const [value, setValue] = createPrimitiveTemplate(true);
expect(value(), "initial value should be true").toBe(true);
const mutable = createMutable({ value: 0 });
expect(mutable.value).toBe(0);

mutable.value = 1;
expect(mutable.value).toBe(1);
});
});

0 comments on commit ee0dd78

Please sign in to comment.