30 lines
466 B
TypeScript
30 lines
466 B
TypeScript
import { test, expect } from 'vitest';
|
|
|
|
import { Updux } from './Updux.js';
|
|
|
|
const bar = new Updux({initial: 123});
|
|
|
|
const foo = new Updux({
|
|
initial: { root: 'abc' },
|
|
subduxes: {
|
|
bar,
|
|
},
|
|
});
|
|
|
|
test( 'single dux', () => {
|
|
const foo = new Updux({
|
|
initial: { a: 1 }
|
|
});
|
|
|
|
expect(foo.initial).toEqual({a:1});
|
|
|
|
} );
|
|
|
|
test( 'initial value', () => {
|
|
|
|
expect(foo.initial).toEqual({
|
|
root: 'abc',
|
|
bar: 123
|
|
})
|
|
} );
|