Skip to content

🎥 Make videos programmatically with React

fix some any

Jonny Burger016beb801c56
diff --git a/packages/core/src/test/bezier.test.ts b/packages/core/src/test/bezier.test.ts
index 98535a6003..f0909a899e 100644
--- a/packages/core/src/test/bezier.test.ts
+++ b/packages/core/src/test/bezier.test.ts
@@ -1,6 +1,6 @@
import {bezier} from '../bezier';
-const identity = (x: any) => {
+const identity = (x: number) => {
return x;
};
@@ -20,7 +20,7 @@ const allEquals = (
};
function repeat(n: number) {
- return function (f: any) {
+ return function (f: Function) {
for (let i = 0; i < n; ++i) {
f();
}
diff --git a/packages/core/src/test/volume-prop.test.ts b/packages/core/src/test/volume-prop.test.ts
index 691bb5bd99..0b3cd11f01 100644
--- a/packages/core/src/test/volume-prop.test.ts
+++ b/packages/core/src/test/volume-prop.test.ts
@@ -33,12 +33,19 @@ describe('evaluateVolume throws exception', () => {
evaluateVolume(toEvaluate);
}, /volume is not a function/);
});
- test('It should throw if frame is invalid type', () => {
- const invalidFrame = 'NaN';
- const toEvaluate = {frame: invalidFrame, volume: (frame: any) => frame};
+ test('It should throw if volume is invalid type', () => {
+ const invalidVolume = 'anystring';
+ const toEvaluate = {frame: 1, volume: () => invalidVolume};
expectToThrow(() => {
// @ts-expect-error
evaluateVolume(toEvaluate);
- }, new RegExp(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof invalidFrame} for frame ${invalidFrame}`));
+ }, new RegExp(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof invalidVolume} for frame 1`));
+ });
+ test('It should throw if volume is NaN', () => {
+ const invalidVolume = NaN;
+ const toEvaluate = {frame: 1, volume: () => invalidVolume};
+ expectToThrow(() => {
+ evaluateVolume(toEvaluate);
+ }, new RegExp('You passed in a function to the volume prop but it returned NaN for frame 1'));
});
});