From: Tiago Melo Date: Thu, 17 May 2018 17:08:51 +0000 (+0100) Subject: mgr/dashboard: Use Jest in package.json scripts X-Git-Tag: v14.0.0~57^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=41d1f9b4b1de2535240df8e10dea46d34777e5b2;p=ceph-ci.git mgr/dashboard: Use Jest in package.json scripts Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index 0074e8bee1b..3f3c414cffb 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 215dacd1629..edf141d9165 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 20303e20edb..ea7522e4c73 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