Skip to content

Commit 86d7e3d

Browse files
dawangkgithub-actions[bot]
authored andcommitted
Auto-formatted the code using Prettier
1 parent 65ab8b8 commit 86d7e3d

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed
Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
1-
import {describe, expect, it, test} from '@jest/globals';
1+
import { describe, expect, it, test } from "@jest/globals";
22

3-
import {convertTimestampToLocaleTime} from '../src/utils/convert-timestamp-to-locale-time';
3+
import { convertTimestampToLocaleTime } from "../src/utils/convert-timestamp-to-locale-time";
44

5-
describe('convertTimestampToLocaleTime', () => {
6-
test(
7-
'should convert a valid timestamp string to a locale time string', () => {
8-
const timestamp = '2025-03-28T12:00:00Z';
9-
const result = convertTimestampToLocaleTime(timestamp);
10-
expect(typeof result).toBe('string');
11-
expect(result.length)
12-
.toBeGreaterThan(0); // Ensures it returns a non-empty string
13-
});
5+
describe("convertTimestampToLocaleTime", () => {
6+
test("should convert a valid timestamp string to a locale time string", () => {
7+
const timestamp = "2025-03-28T12:00:00Z";
8+
const result = convertTimestampToLocaleTime(timestamp);
9+
expect(typeof result).toBe("string");
10+
expect(result.length).toBeGreaterThan(0); // Ensures it returns a non-empty string
11+
});
1412

15-
test(
16-
'should convert a valid numeric timestamp to a locale time string',
17-
() => {
18-
const timestamp = 1711622400000; // Equivalent to 2025-03-28T12:00:00Z
19-
// in milliseconds
20-
const result = convertTimestampToLocaleTime(timestamp);
21-
expect(typeof result).toBe('string');
22-
expect(result.length).toBeGreaterThan(0);
23-
});
13+
test("should convert a valid numeric timestamp to a locale time string", () => {
14+
const timestamp = 1711622400000; // Equivalent to 2025-03-28T12:00:00Z
15+
// in milliseconds
16+
const result = convertTimestampToLocaleTime(timestamp);
17+
expect(typeof result).toBe("string");
18+
expect(result.length).toBeGreaterThan(0);
19+
});
2420

25-
test('convert to locale time date is different', () => {
26-
const timestamp = '2025-03-28 02:33:02.589Z';
21+
test("convert to locale time date is different", () => {
22+
const timestamp = "2025-03-28 02:33:02.589Z";
2723
const result = convertTimestampToLocaleTime(timestamp);
28-
expect(typeof result).toBe('string');
24+
expect(typeof result).toBe("string");
2925
expect(result.length).toBeGreaterThan(0);
3026
});
3127

32-
test('should return \'Invalid Date\' for an invalid timestamp', () => {
33-
const timestamp = 'invalid';
28+
test("should return 'Invalid Date' for an invalid timestamp", () => {
29+
const timestamp = "invalid";
3430
const result = convertTimestampToLocaleTime(timestamp);
35-
expect(result).toBe('Invalid Date');
31+
expect(result).toBe("Invalid Date");
3632
});
3733
});

0 commit comments

Comments
 (0)