Skip to content

Commit

Permalink
Add regression test for #992
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnocorp committed Dec 7, 2018
1 parent 947b215 commit 96ad40c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/test/regression.sh
Expand Up @@ -8,4 +8,5 @@ set -ex

export PATH="$(yarn bin):$PATH"

env TZ=America/Sao_Paulo babel-node ./test/regression/972.js
env TZ=America/Sao_Paulo babel-node ./test/regression/972.js
env TZ=America/Sao_Paulo babel-node ./test/regression/992.js
15 changes: 15 additions & 0 deletions test/regression/992.js
@@ -0,0 +1,15 @@
// This is a regression test for issue #992: https://github.com/date-fns/date-fns/issues/992

import toDate from '../../src/toDate'
import getDay from '../../src/getDay'
import assert from 'assert'

if (process.env.TZ !== 'America/Sao_Paulo')
throw new Error('The test must be run with TZ=America/Sao_Paulo')

const result = getDay(toDate('2018-11-04'))
const expectation = 0
assert(
result === expectation,
`The result should be equal ${expectation} but got ${result}`
)

0 comments on commit 96ad40c

Please sign in to comment.