Skip to content

Commit

Permalink
Merge pull request #102 from andostronaut/develop
Browse files Browse the repository at this point in the history
feat: implement test for get current month
  • Loading branch information
Ando authored Jun 5, 2024
2 parents 3a0b990 + 2966c63 commit f57922f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/utils_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from '../deps.ts'
import { isValidHttpUrl, getTimestamp, generateFileName, humanizeDuration } from '../src/utils.ts'
import { isValidHttpUrl, getTimestamp, generateFileName, humanizeDuration, getCurrentMonth } from '../src/utils.ts'

Deno.test('isValidHttpUrl should return true for valid HTTP URLs', () => {
assert.assertEquals(isValidHttpUrl({ url: 'http://example.com' }), true)
Expand Down Expand Up @@ -102,3 +102,22 @@ Deno.test(
}
);

Deno.test(
"getCurrentMonth should return correct month name for long type",
() => {
assert.assertEquals(
getCurrentMonth({ type: "long" }),
new Date().toLocaleString("en-US", { month: "long" })
);
}
);

Deno.test(
"getCurrentMonth should return correct month abbreviation for short type",
() => {
assert.assertEquals(
getCurrentMonth({ type: "short" }),
new Date().toLocaleString("en-US", { month: "short" })
);
}
);

0 comments on commit f57922f

Please sign in to comment.