From 41d1f9b4b1de2535240df8e10dea46d34777e5b2 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 17 May 2018 18:08:51 +0100 Subject: [PATCH] mgr/dashboard: Use Jest in package.json scripts Signed-off-by: Tiago Melo --- src/pybind/mgr/dashboard/HACKING.rst | 4 ++-- src/pybind/mgr/dashboard/frontend/package.json | 3 ++- src/pybind/mgr/dashboard/run-frontend-unittests.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index 0074e8bee1b63..3f3c414cffbce 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -66,8 +66,8 @@ production build. Navigate to ``https://localhost:8080``. Running Unit Tests ~~~~~~~~~~~~~~~~~~ -Run ``npm run test`` to execute the unit tests via `Karma -`_. +Run ``npm run test`` to execute the unit tests via `Jest +`_. Running End-to-End Tests ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 215dacd162974..edf141d9165d7 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -6,7 +6,8 @@ "ng": "ng", "start": "ng serve --delete-output-path false --proxy-config proxy.conf.json --host 0.0.0.0", "build": "ng build", - "test": "ng test", + "test": "jest --watch", + "test:ci": "jest --coverage", "lint": "ng lint", "e2e": "ng e2e", "makePretty": "pretty-quick --staged" diff --git a/src/pybind/mgr/dashboard/run-frontend-unittests.sh b/src/pybind/mgr/dashboard/run-frontend-unittests.sh index 20303e20edb15..ea7522e4c733f 100755 --- a/src/pybind/mgr/dashboard/run-frontend-unittests.sh +++ b/src/pybind/mgr/dashboard/run-frontend-unittests.sh @@ -7,7 +7,7 @@ cd $CEPH_ROOT/src/pybind/mgr/dashboard/frontend . $CEPH_ROOT/build/src/pybind/mgr/dashboard/node-env/bin/activate npm run build -- --prod -npm run test -- --browsers PhantomJS --watch=false +npm run test:ci npm run lint deactivate -- 2.39.5