Skip to content

🎥 Make videos programmatically with React

improve test code smells

Tobias Bonerbfb92bd673eb
diff --git a/packages/core/src/test/spring.test.ts b/packages/core/src/test/spring.test.ts
index d657664e5a..2e19704407 100644
--- a/packages/core/src/test/spring.test.ts
+++ b/packages/core/src/test/spring.test.ts
@@ -1,38 +1,46 @@
import {isApproximatelyTheSame} from '../is-approximately-the-same';
import {spring} from '../spring';
-test('Basic spring should work', () => {
- expect(
- spring({
- fps: 30,
- frame: 0,
- })
- ).toEqual(0);
+describe('Basic spring should work', () => {
+ test('Basic spring to equal 0', () => {
+ expect(
+ spring({
+ fps: 30,
+ frame: 0,
+ })
+ ).toEqual(0);
+ });
- expect(
- spring({
- fps: 30,
- frame: 0,
- from: 1,
- to: 0,
- })
- ).toEqual(1);
+ test('Basic spring to equal 1', () => {
+ expect(
+ spring({
+ fps: 30,
+ frame: 0,
+ from: 1,
+ to: 0,
+ })
+ ).toEqual(1);
+ });
});
-test('Spring should go to 1', () => {
- expect(
- isApproximatelyTheSame(
+describe('Spring should go to 1', () => {
+ test('Should be approxmiately the same', () => {
+ expect(
+ isApproximatelyTheSame(
+ spring({
+ fps: 30,
+ frame: 1,
+ }),
+ 0.04941510804510185
+ )
+ ).toBe(true);
+ });
+ test('Should be close to 1', () => {
+ expect(
spring({
fps: 30,
- frame: 1,
- }),
- 0.04941510804510185
- )
- ).toBe(true);
- expect(
- spring({
- fps: 30,
- frame: 100,
- })
- ).toBeCloseTo(1);
+ frame: 100,
+ })
+ ).toBeCloseTo(1);
+ });
});