summaryrefslogtreecommitdiff
path: root/date-fns/src/isWednesday/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'date-fns/src/isWednesday/test.ts')
-rw-r--r--date-fns/src/isWednesday/test.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/date-fns/src/isWednesday/test.ts b/date-fns/src/isWednesday/test.ts
new file mode 100644
index 0000000..c4b1a7a
--- /dev/null
+++ b/date-fns/src/isWednesday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isWednesday from '.'
+
+describe('isWednesday', function () {
+ it('returns true if the given date is Wednesday', function () {
+ const result = isWednesday(new Date(2014, 8 /* Sep */, 24))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Wednesday', function () {
+ const result = isWednesday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function () {
+ const result = isWednesday(new Date(2014, 1 /* Feb */, 12).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function () {
+ const result = isWednesday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(isWednesday.bind(null), TypeError)
+ })
+})