Last active
May 24, 2023 07:47
-
-
Save philihp/43a1b4e107a0e55163d774824a13547e to your computer and use it in GitHub Desktop.
Revisions
-
philihp revised this gist
May 24, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ import { getDayOfWeek } from './dayOfWeek' import test from 'node:test' import assert from 'node:assert/strict' -
philihp created this gist
May 24, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import { getDayOfWeek } from '../dayOfWeek' import test from 'node:test' import assert from 'node:assert/strict' describe('dayOfWeek', () => { test('returns Sunday', () => { assert.strictEqual(getDayOfWeek(1), ('Sunday')) }) test('returns Monday', () => { assert.strictEqual(getDayOfWeek(2), ('Monday')) }) test('returns Tuesday', () => { assert.strictEqual(getDayOfWeek(3), ('Tuesday')) }) test('returns Wednesday', () => { assert.strictEqual(getDayOfWeek(4), ('Wednesday')) }) test('returns Thursday', () => { assert.strictEqual(getDayOfWeek(5), ('Thursday')) }) test('returns Friday', () => { assert.strictEqual(getDayOfWeek(6), ('Friday')) }) test('returns Saturday', () => { assert.strictEqual(getDayOfWeek(7), ('Saturday')) }) }) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ import { partial, pipe } from 'ramda' export const getDayOfWeek = pipe( partial(Date.UTC, [1984, 3]), Intl.DateTimeFormat(undefined, { weekday: 'long' }).format )