Skip to content

Commit 22c832a

Browse files
committed
add precommit and prepush hook for testing using husky
1 parent d1019ac commit 22c832a

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"README.md"
88
],
99
"scripts": {
10-
"prepublish": "npm run test",
10+
"prepublish": "npm test",
11+
"precommit": "npm test",
12+
"prepush": "npm test",
1113
"build": "rm -rf dist && tsc",
1214
"pretest": "npm run lint",
1315
"test": "jest",
@@ -17,6 +19,7 @@
1719
"@types/fs-extra": "^2.0.0",
1820
"@types/jest": "^19.2.2",
1921
"@types/lodash": "^4.14.62",
22+
"husky": "^0.13.3",
2023
"jest": "^19.0.2",
2124
"serverless": "^1.11.0",
2225
"ts-jest": "^19.0.10",

yarn.lock

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,10 @@ fill-range@^2.1.0:
936936
repeat-element "^1.1.2"
937937
repeat-string "^1.5.2"
938938

939+
find-parent-dir@^0.3.0:
940+
version "0.3.0"
941+
resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54"
942+
939943
find-up@^1.0.0:
940944
version "1.1.2"
941945
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -1244,6 +1248,15 @@ https-proxy-agent@^1.0.0:
12441248
debug "2"
12451249
extend "3"
12461250

1251+
husky@^0.13.3:
1252+
version "0.13.3"
1253+
resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.3.tgz#bc2066080badc8b8fe3516e881f5bc68a57052ff"
1254+
dependencies:
1255+
chalk "^1.1.3"
1256+
find-parent-dir "^0.3.0"
1257+
is-ci "^1.0.9"
1258+
normalize-path "^1.0.0"
1259+
12471260
iconv-lite@0.4.13, iconv-lite@~0.4.13:
12481261
version "0.4.13"
12491262
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2"
@@ -2123,6 +2136,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
21232136
semver "2 || 3 || 4 || 5"
21242137
validate-npm-package-license "^3.0.1"
21252138

2139+
normalize-path@^1.0.0:
2140+
version "1.0.0"
2141+
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379"
2142+
21262143
normalize-path@^2.0.0, normalize-path@^2.0.1:
21272144
version "2.1.1"
21282145
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
@@ -2507,14 +2524,10 @@ sane@~1.5.0:
25072524
walker "~1.0.5"
25082525
watch "~0.10.0"
25092526

2510-
sax@1.2.1:
2527+
sax@1.2.1, sax@>=0.6.0, sax@^1.2.1:
25112528
version "1.2.1"
25122529
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
25132530

2514-
sax@>=0.6.0, sax@^1.2.1:
2515-
version "1.2.2"
2516-
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828"
2517-
25182531
seek-bzip@^1.0.5:
25192532
version "1.0.5"
25202533
resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc"

0 commit comments

Comments
 (0)