Skip to content

Commit

Permalink
fix eslint failed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
amitamrutiya committed Feb 13, 2024
1 parent c1731ed commit 2c3fc77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions backend/test/utils/secToDuration.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import convertSecondsToDuration from "../../utils/secToDuration";
import convertSecondsToDuration from "../../utils/secToDuration"

describe("convertSecondsToDuration", () => {

Check failure on line 3 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'describe' is not defined

Check failure on line 3 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'describe' is not defined
it("should correctly convert seconds to hours and minutes", () => {

Check failure on line 4 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined

Check failure on line 4 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined
expect(convertSecondsToDuration(3661)).toBe("1h 1m");
});
expect(convertSecondsToDuration(3661)).toBe("1h 1m")

Check failure on line 5 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined

Check failure on line 5 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined
})

it("should correctly convert seconds to minutes and seconds", () => {

Check failure on line 8 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined

Check failure on line 8 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined
expect(convertSecondsToDuration(61)).toBe("1m 1s");
});
expect(convertSecondsToDuration(61)).toBe("1m 1s")

Check failure on line 9 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined

Check failure on line 9 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined
})

it("should correctly convert seconds to seconds", () => {

Check failure on line 12 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined

Check failure on line 12 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined
expect(convertSecondsToDuration(1)).toBe("1s");
});
});
expect(convertSecondsToDuration(1)).toBe("1s")

Check failure on line 13 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined

Check failure on line 13 in backend/test/utils/secToDuration.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined
})
})
20 changes: 10 additions & 10 deletions frontend/src/test/utils/avgRating.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import GetAvgRating from "../../utils/avgRating";
import GetAvgRating from "../../utils/avgRating"

describe("GetAvgRating", () => {

Check failure on line 3 in frontend/src/test/utils/avgRating.test.js

View workflow job for this annotation

GitHub Actions / build

'describe' is not defined

Check failure on line 3 in frontend/src/test/utils/avgRating.test.js

View workflow job for this annotation

GitHub Actions / build

'describe' is not defined
it("should return 0 when the array is empty", () => {

Check failure on line 4 in frontend/src/test/utils/avgRating.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined

Check failure on line 4 in frontend/src/test/utils/avgRating.test.js

View workflow job for this annotation

GitHub Actions / build

'it' is not defined
expect(GetAvgRating([])).toBe(0);
});
expect(GetAvgRating([])).toBe(0)

Check failure on line 5 in frontend/src/test/utils/avgRating.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined

Check failure on line 5 in frontend/src/test/utils/avgRating.test.js

View workflow job for this annotation

GitHub Actions / build

'expect' is not defined
})

it("should correctly calculate the average rating", () => {
const ratings = [
Expand All @@ -12,12 +12,12 @@ describe("GetAvgRating", () => {
{ rating: 3 },
{ rating: 2 },
{ rating: 1 },
];
expect(GetAvgRating(ratings)).toBe(3);
});
]
expect(GetAvgRating(ratings)).toBe(3)
})

it("should correctly round the average rating to one decimal place", () => {
const ratings = [{ rating: 5 }, { rating: 4 }, { rating: 4 }];
expect(GetAvgRating(ratings)).toBe(4.3);
});
});
const ratings = [{ rating: 5 }, { rating: 4 }, { rating: 4 }]
expect(GetAvgRating(ratings)).toBe(4.3)
})
})

0 comments on commit 2c3fc77

Please sign in to comment.