Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e3e089
commit 03bbf4d
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// This is basic DST test for addBusinessDays | ||
|
||
import assert from 'assert' | ||
import addBusinessDays from '../../../src/addBusinessDays' | ||
|
||
if (process.env.TZ !== 'America/Santiago') | ||
throw new Error('The test must be run with TZ=America/Santiago') | ||
|
||
if (parseInt(process.version.match(/^v(\d+)\./)[1]) < 10) | ||
throw new Error('The test must be run on Node.js version >= 10') | ||
|
||
console.log(addBusinessDays(new Date(2014, 8 /* Sep */, 1), 10).toString()) | ||
|
||
assert.deepEqual( | ||
// new Date(2014, 8, 7) is the DST day | ||
addBusinessDays(new Date(2014, 8 /* Sep */, 1), 10).toString(), | ||
'Mon Sep 15 2014 00:00:00 GMT-0300 (Chile Summer Time)' | ||
) |