element-plus/packages/utils/__tests__/animation.test.ts
三咲智子 1d13ebb05d
feat: drop jest (#7248)
* feat: drop jest

* test: remove ssr

* test: rename

* chore: update tsconfig
2022-04-19 16:51:44 +08:00

17 lines
572 B
TypeScript

import { describe, expect, it } from 'vitest'
import { cubic, easeInOutCubic } from '..'
describe('animation', () => {
it('cubic should work', () => {
expect(cubic(1)).toMatchInlineSnapshot('1')
expect(cubic(5)).toMatchInlineSnapshot('125')
expect(cubic(10)).toMatchInlineSnapshot('1000')
})
it('easeInOutCubic should work', () => {
expect(easeInOutCubic(1)).toMatchInlineSnapshot('1')
expect(easeInOutCubic(0.8).toFixed(4)).toMatchInlineSnapshot('"0.9680"')
expect(easeInOutCubic(0.4).toFixed(4)).toMatchInlineSnapshot('"0.2560"')
})
})