Run npm test as a pre-commit hook

Adds the `pre-commit` npm package which automatically
handles git pre-commit hooks via package.json and runs
`npm run test` by default.

https://www.npmjs.com/package/pre-commit

Requires an `npm install`

Change-Id: Ia5950242bced753c42fc804fd686bc239c335aa3
This commit is contained in:
Jan Drewniak 2018-05-02 16:35:35 +02:00
parent 142bb570c1
commit 503756822c
2 changed files with 28 additions and 0 deletions

27
package-lock.json generated
View file

@ -2440,6 +2440,12 @@
"lcid": "1.0.0"
}
},
"os-shim": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz",
"integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=",
"dev": true
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
@ -2647,6 +2653,17 @@
"integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=",
"dev": true
},
"pre-commit": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz",
"integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=",
"dev": true,
"requires": {
"cross-spawn": "5.1.0",
"spawn-sync": "1.0.15",
"which": "1.2.14"
}
},
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
@ -2980,6 +2997,16 @@
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
},
"spawn-sync": {
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz",
"integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=",
"dev": true,
"requires": {
"concat-stream": "1.6.0",
"os-shim": "0.1.3"
}
},
"spdx-correct": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",

View file

@ -17,6 +17,7 @@
"grunt-jsonlint": "1.1.0",
"grunt-notify": "0.4.5",
"grunt-stylelint": "0.8.0",
"pre-commit": "1.2.2",
"stylelint": "7.8.0",
"stylelint-config-wikimedia": "0.4.1"
}