Skip to content
Source
Sign inSign up
TanStack/time

fix: parse error handling #6

Closedbart-krakowski(GitHub profile, opens in a new tab)wants to merge 5 commits intov0 fromrefs/pull/6/headopened

Showing 3 changed files with 6 additions and 6 deletions.

x
0 of 3 viewed, 3 left
2 additions and 2 deletionspackages/time/src/tests/isValidDate.test.tsModified
View file
@@ -4,7 +4,7 @@
describe('isValidDate', () => {
test('should return true for a valid date', () => {
expect(isValidDate(new Date())).toBe(true);
- });
+ })
​
test('should return false for an invalid date', () => {
expect(isValidDate(new Date("invalid"))).toBe(false);
@@ -13,4 +13,4 @@
test("should return false for null", () => {
expect(isValidDate(null)).toBe(false);
});
-});
+});
3 additions and 3 deletionspackages/time/src/tests/parse.test.tsModified
View file
@@ -102,11 +102,11 @@
});
​
test('should throw an error for an invalid date string', () => {
- expect(() => parse('2021-15-37')).toThrowError('"2021-15-37" is an invalid RFC339 Internet Date Time string');
+ expect(() => parse('2021-15-37')).toThrowError('"2021-15-37" is an invalid RFC3339 Internet Date Time string');
});
​
test('should throw an error for an invalid time string', () => {
- expect(() => parse('27:62')).toThrowError('"27:62" is an invalid RFC339 Internet Date Time string');
+ expect(() => parse('27:62')).toThrowError('"27:62" is an invalid RFC3339 Internet Date Time string');