@remotion/player
Version:
React component for embedding a Remotion preview into your app
57 lines (56 loc) • 2.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const bun_test_1 = require("bun:test");
const validate_in_out_frame_js_1 = require("../utils/validate-in-out-frame.js");
(0, bun_test_1.test)('Validate in out frames', () => {
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: 201,
outFrame: undefined,
})).toThrow(/inFrame must be less than \(durationInFrames - 1\)/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: 199,
outFrame: 201,
})).toThrow(/outFrame must be less than \(durationInFrames - 1\)/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: -10,
outFrame: null,
})).toThrow(/inFrame must be greater than 0, but is -10/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: null,
outFrame: -10,
})).toThrow(/outFrame must be greater than 0, but is -10/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: 1.5,
outFrame: null,
})).toThrow(/"inFrame" must be an integer, but is 1.5/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: 20,
outFrame: 20,
})).toThrow(/outFrame must be greater than inFrame, but is 20/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: 21,
outFrame: 20,
})).toThrow(/outFrame must be greater than inFrame, but is 20 <= 21/);
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: null,
outFrame: 20,
})).not.toThrow();
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: null,
outFrame: null,
})).not.toThrow();
(0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
durationInFrames: 200,
inFrame: 10,
outFrame: 20,
})).not.toThrow();
});