Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
add some test
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed May 16, 2019
1 parent 012c6d0 commit 6ec941d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test('Events', (t) => {
})

test('Value Interpolation', (t) => {
let obj = { a: 0, b: 'B value 1', c: { x: 2 }, d: [3], _e: 4, g: 5, h: 0, j: 0, k: '#000' }
let obj = { a: 0, b: 'B value 1', c: { x: 2 }, d: [3], _e: 4, g: 5, h: 0, j: 0, k: '#000', l: '#0cf', m: '#fc0' }

Object.defineProperty(obj, 'e', {
get () {
Expand All @@ -70,7 +70,9 @@ test('Value Interpolation', (t) => {
g: '+=1',
h: 250000,
j: [1, 2],
k: ['rgb(100, 100, 100)', 'rgb(200, 200, 200)']
k: ['rgb(100, 100, 100)', 'rgb(200, 200, 200)'],
l: '#fc0',
m: '#0cf'
},
100
)
Expand All @@ -87,6 +89,8 @@ test('Value Interpolation', (t) => {
t.is(obj.h, 0)
t.is(obj.j, 0)
t.is(obj.k, 'rgb(0, 0, 0)')
t.is(obj.l, 'rgb(0, 204, 255)')
t.is(obj.m, 'rgb(255, 204, 0)')

update(50)

Expand Down Expand Up @@ -128,6 +132,8 @@ test('Value Interpolation', (t) => {
t.is(obj.h, 250000, 'Big number interpolation ending value not worked as excepted')
t.is(obj.j, 2, 'Multi-Interpolation not worked as excepted')
t.is(obj.k, 'rgb(200, 200, 200)', 'Multi-Interpolation not worked as excepted')
t.is(obj.l, 'rgb(255, 204, 0)', 'String interpolation not worked as excepted')
t.is(obj.m, 'rgb(0, 204, 255)', 'String interpolation not worked as excepted')
})

test('Value Array-based Interpolation', (t) => {
Expand Down

0 comments on commit 6ec941d

Please sign in to comment.