diff --git a/src/createStore.test.todo b/src/createStore.test.todo deleted file mode 100644 index 286de5e..0000000 --- a/src/createStore.test.todo +++ /dev/null @@ -1,18 +0,0 @@ -import { test, expect } from 'vitest'; -import { Updux } from './Updux.js'; - -test('basic createStore', async () => { - const foo = new Updux({ - initial: { a: 1 }, - actions: { - a1: null, - }, - }); - - const store = foo.createStore(); - - expect(store.getState).toBeTypeOf('function'); - expect(store.getState()).toEqual({ a: 1 }); - - expect(store.actions.a1).toBeTypeOf('function'); -}); diff --git a/src/reactions.test.todo b/src/reactions.test.todo deleted file mode 100644 index 8f006f8..0000000 --- a/src/reactions.test.todo +++ /dev/null @@ -1,30 +0,0 @@ -import { test, expect, vi } from 'vitest'; - -import { Updux } from './Updux.js'; - - -test('subduxes reactions', async () => { - const spyA = vi.fn(); - const spyB = vi.fn(); - const foo = new Updux({ - subduxes: { - a: new Updux({ - initial: 1, - reactions: [() => (state) => spyA(state)], - actions: { inc: null }, - mutations: { - inc: () => (state) => state + 1, - }, - }), - b: new Updux({ initial: 10, reactions: [() => spyB] }), - }, - }); - - const store = foo.createStore(); - store.dispatch.inc(); - store.dispatch.inc(); - - expect(spyA).toHaveBeenCalledTimes(2); - expect(spyA).toHaveBeenCalledWith(3); - expect(spyB).toHaveBeenCalledOnce(); // the original inc initialized the state -}); diff --git a/src/utils.todo b/src/utils.todo deleted file mode 100644 index 956a5ff..0000000 --- a/src/utils.todo +++ /dev/null @@ -1,6 +0,0 @@ -export const matches = (conditions) => (target) => - Object.entries(conditions).every(([key, value]) => - typeof value === 'function' - ? value(target[key]) - : target[key] === value, - );