Skip to content

Commit

Permalink
test(mockDate): reset mochdate after all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoTron committed Oct 14, 2017
1 parent 7f21b44 commit b438ac6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 162 deletions.
160 changes: 0 additions & 160 deletions coverage.lcov
Original file line number Diff line number Diff line change
@@ -1,160 +0,0 @@
TN:
SF:/Users/stefano/Documents/Dev/businessHours/business-hours/src/index.js
FN:23,BusinessHours
FN:41,(anonymous_9)
FN:75,(anonymous_12)
FN:138,(anonymous_19)
FNF:4
FNH:4
FNDA:1,BusinessHours
FNDA:8,(anonymous_9)
FNDA:10,(anonymous_12)
FNDA:11,(anonymous_19)
DA:1,1
DA:2,1
DA:3,1
DA:4,1
DA:5,1
DA:6,1
DA:7,1
DA:8,1
DA:9,1
DA:10,1
DA:12,1
DA:23,1
DA:24,1
DA:25,1
DA:29,18
DA:30,17
DA:31,14
DA:32,14
DA:33,14
DA:34,13
DA:37,2
DA:38,2
DA:39,1
DA:41,2
DA:42,8
DA:43,1
DA:45,7
DA:46,6
DA:47,0
DA:48,6
DA:49,0
DA:50,6
DA:51,0
DA:54,6
DA:55,0
DA:63,1
DA:66,3
DA:67,3
DA:70,6
DA:71,6
DA:73,6
DA:74,6
DA:75,4
DA:76,10
DA:77,10
DA:78,10
DA:79,10
DA:80,10
DA:81,10
DA:82,10
DA:83,10
DA:84,10
DA:86,10
DA:88,4
DA:92,20
DA:93,20
DA:94,19
DA:95,14
DA:97,5
DA:100,1
DA:103,2
DA:104,2
DA:107,2
DA:108,2
DA:111,11
DA:112,11
DA:113,11
DA:114,6
DA:117,11
DA:118,11
DA:119,13
DA:120,11
DA:122,2
DA:125,11
DA:129,5
DA:130,5
DA:131,1
DA:133,4
DA:136,6
DA:137,6
DA:138,6
DA:139,11
DA:140,11
DA:141,11
DA:142,11
DA:143,11
DA:144,11
DA:145,11
DA:150,11
DA:151,5
DA:152,5
DA:156,6
DA:162,1
LF:93
LH:89
BRDA:29,0,0,1
BRDA:29,0,1,17
BRDA:30,1,0,3
BRDA:30,1,1,14
BRDA:31,2,0,0
BRDA:31,2,1,14
BRDA:33,3,0,1
BRDA:33,3,1,13
BRDA:38,4,0,1
BRDA:38,4,1,1
BRDA:42,5,0,1
BRDA:42,5,1,7
BRDA:45,6,0,6
BRDA:45,6,1,1
BRDA:46,7,0,0
BRDA:46,7,1,6
BRDA:48,8,0,0
BRDA:48,8,1,6
BRDA:50,9,0,0
BRDA:50,9,1,6
BRDA:54,10,0,0
BRDA:54,10,1,6
BRDA:66,11,0,3
BRDA:66,11,1,0
BRDA:66,12,0,3
BRDA:66,12,1,3
BRDA:70,13,0,6
BRDA:70,13,1,0
BRDA:70,14,0,6
BRDA:70,14,1,6
BRDA:74,15,0,2
BRDA:74,15,1,4
BRDA:93,16,0,19
BRDA:93,16,1,1
BRDA:93,17,0,20
BRDA:93,17,1,7
BRDA:94,18,0,14
BRDA:94,18,1,5
BRDA:111,19,0,7
BRDA:111,19,1,4
BRDA:111,20,0,11
BRDA:111,20,1,7
BRDA:113,21,0,6
BRDA:113,21,1,5
BRDA:119,22,0,11
BRDA:119,22,1,2
BRDA:130,23,0,1
BRDA:130,23,1,4
BRDA:150,24,0,5
BRDA:150,24,1,6
BRF:50
BRH:43
end_of_record
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "dist/index.js",
"scripts": {
"commit": "git-cz",
"report-coverage":
"nyc report --reporter=text-lcov > coverage.lcov && codecov",

"report-coverage": "nyc report --reporter=lcov > coverage.lcov && codecov",
"prebuild": "rimraf dist",
"build": "babel --copy-files --out-dir dist --ignore *.test.js src",
"test": "mocha --compilers js:babel-register src/index.test.js -w",
Expand Down
3 changes: 3 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import format from "date-fns/format";
bh.init();

describe("business-hours-js", function() {
after(function() {
MockDate.reset();
});
describe("isOpenNow", function() {
it("outside business hours, should equal false", function() {
expect(bh.isOpenNow(new Date(2017, 9, 1, 16, 0))).to.equal(false);
Expand Down

0 comments on commit b438ac6

Please sign in to comment.