updux/src/actions.test.ts

15 lines
295 B
TypeScript

import { test, expect } from 'vitest';
import { action } from './actions.js';
test('basic action', () => {
const foo = action('foo', (thing: string) => ({ thing }));
expect(foo('bar')).toEqual({
type: 'foo',
payload: {
thing: 'bar',
},
});
});