summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2021-01-05 22:37:35 +0300
committerDerick Montague <derick.montague@ibm.com>2021-01-20 00:56:19 +0300
commit9faf55ede63bc596d1d1678085dc026ffb14d99d (patch)
tree6da7a6a4c7e7d048dbd18a95c2e3fc2768febc20
parentac2b3f08f4bc46d088756b41d63e523ab4f71f2a (diff)
downloadwebui-vue-9faf55ede63bc596d1d1678085dc026ffb14d99d.tar.xz
Run test script as part of the pre-commit hook
Now that we have added more unit testing, it will be beneficial to run the unit test script prior to check in. Eventually, we will want this to be part of the CI build process since Git pre-hooks can be avoided. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I59aad81a470176d2f6a5afeb130661c642f4d259
-rw-r--r--package.json2
-rw-r--r--tests/unit/Global/__snapshots__/InputPasswordToggle.spec.js.snap1
-rw-r--r--tests/unit/Global/__snapshots__/TableCellCount.spec.js.snap2
3 files changed, 4 insertions, 1 deletions
diff --git a/package.json b/package.json
index 38f56ec6..e020bb33 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"node": ">=12.14.1"
},
"gitHooks": {
- "pre-commit": "lint-staged"
+ "pre-commit": "lint-staged && vue-cli-service test:unit"
},
"lint-staged": {
"*.{js,vue}": [
diff --git a/tests/unit/Global/__snapshots__/InputPasswordToggle.spec.js.snap b/tests/unit/Global/__snapshots__/InputPasswordToggle.spec.js.snap
index 6421ddc7..2ecada11 100644
--- a/tests/unit/Global/__snapshots__/InputPasswordToggle.spec.js.snap
+++ b/tests/unit/Global/__snapshots__/InputPasswordToggle.spec.js.snap
@@ -4,6 +4,7 @@ exports[`InputPasswordToggle.vue should render correctly 1`] = `
<div
class="input-password-toggle-container"
>
+
<button
aria-label="global.ariaLabel.hidePassword"
class="btn input-action-btn btn-icon-only btn-link isVisible"
diff --git a/tests/unit/Global/__snapshots__/TableCellCount.spec.js.snap b/tests/unit/Global/__snapshots__/TableCellCount.spec.js.snap
index 2906cb82..c0a1cdb6 100644
--- a/tests/unit/Global/__snapshots__/TableCellCount.spec.js.snap
+++ b/tests/unit/Global/__snapshots__/TableCellCount.spec.js.snap
@@ -5,7 +5,9 @@ exports[`TableCellCount.vue should render correctly 1`] = `
class="mt-2"
>
<p>
+
global.table.items
+
</p>
</div>
`;