mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 01:11:24 +01:00
31 lines
645 B
TypeScript
31 lines
645 B
TypeScript
import * as assert from 'assert';
|
|
import { get } from '../../store';
|
|
import { spring, tweened } from '../../motion';
|
|
|
|
describe('motion', () => {
|
|
describe('spring', () => {
|
|
it('handles initially undefined values', () => {
|
|
const size = spring();
|
|
|
|
size.set(100);
|
|
assert.equal(get(size), 100);
|
|
});
|
|
});
|
|
|
|
describe('tweened', () => {
|
|
it('handles initially undefined values', () => {
|
|
const size = tweened();
|
|
|
|
size.set(100);
|
|
assert.equal(get(size), 100);
|
|
});
|
|
|
|
it('sets immediately when duration is 0', () => {
|
|
const size = tweened(0);
|
|
|
|
size.set(100, { duration : 0 });
|
|
assert.equal(get(size), 100);
|
|
});
|
|
});
|
|
});
|