Skip to content

Commit d9b87d7

Browse files
committed
Add more tests
1 parent d6e2639 commit d9b87d7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/index.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test('errors if keys are different dimensions', () => {
7878
0.5
7979
)
8080
).toThrowError(
81-
'Keyframe 0 and 1 must be of the same dimension. Received number and array'
81+
'Keyframe 0 and 1 values must be of the same type. Received number and array'
8282
);
8383
});
8484

@@ -179,3 +179,17 @@ test('errors if velocityOut is a string', () => {
179179
'Keyframe 0 velocityOut must be of type number. Received string'
180180
);
181181
});
182+
183+
test('errors on unexpected keyframe property', () => {
184+
expect(() =>
185+
// @ts-ignore
186+
animate([{ keyTime: 0, keyValue: 0 }, { keyTime: 1, keyValue: 1 ease: 0}], 0.5)
187+
).toThrowError('Unexpected property on keyframe 1: ease');
188+
});
189+
190+
test('errors if values are arrays of different lengths', () => {
191+
expect(() =>
192+
// @ts-ignore
193+
animate([{ keyTime: 0, keyValue: [0, 0] }, { keyTime: 1, keyValue: [1, 1, 1]}], 0.5)
194+
).toThrowError('Keyframe 0 and 1 values must be of the same dimension. Received 2 and 3');
195+
});

0 commit comments

Comments
 (0)