Mforns has submitted this change and it was merged. Change subject: build run karma test with just "npm test" ......................................................................
build run karma test with just "npm test" Make npm install to also invokes "bower install". One less command to enter/remember. Add bower as a development dependency. Add "gulp" and "karma" scripts, so one execute the proper version via a "npm run". Update README in consquence namely: * reference to "npm run <command>" * drop karma-cli, karma provides a CLI Introduce the "test" command that runs "gulp build" and "karma start". Pass some more args to karma since "npm test" is going to be run by CI. Bug: T148023 Change-Id: Ib7af340856e89c006e0cf62e58c8a15abbac5ada --- M README.md M bower.json M package.json 3 files changed, 16 insertions(+), 12 deletions(-) Approvals: Mforns: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 6d525ef..36d3d44 100644 --- a/README.md +++ b/README.md @@ -14,28 +14,25 @@ git clone https://gerrit.wikimedia.org/r/analytics/mediawiki-storage ``` -We're using Bower for production dependencies, Karma as a test runner and Gulp as a build tool. Make sure you install the following packages globally. -``` -npm install -g bower -npm install -g gulp -npm install -g karma-cli -``` - -Then, install the dependencies to be able to build and run mediawiki-storage and its tests. +We're using Bower for production dependencies, Karma as a test runner and Gulp as a build tool. Then, install the dependencies to be able to build and run mediawiki-storage and its tests. ``` cd mediawiki-storage npm install -bower install ``` Now you can run Gulp tasks to lint, build and clean the project; Where _command_ can be one of: `lint`, `build` or `clean`. If you omit _command_, Gulp defaults to executing _build_ task. ``` -gulp <command> +npm run gulp <command> ``` You can also run the tests, and let Karma test runner watch all files and execute all tests on changes with: ``` -karma start +npm run karma start +``` + +Or run both _gulp build_ and _karma start_ with: +``` +npm test ``` ### API documentation diff --git a/bower.json b/bower.json index 026d1ac..0ed33ac 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "mediawiki-storage", - "version": "0.3.0", + "version": "0.5.0", "authors": [ "Marcel Ruiz Forns <mfo...@wikimedia.org>" ], diff --git a/package.json b/package.json index 1c6afaa..70738b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,14 @@ { "private": true, "name": "mediawiki-storage", + "scripts": { + "postinstall": "bower install", + "gulp": "gulp", + "karma": "karma", + "test": "gulp build && karma start --single-run --log-level=debug" + }, "devDependencies": { + "bower": "^1.7.9", "del": "^0.1.3", "gulp": "^3.8.10", "gulp-jshint": "^1.9.0", -- To view, visit https://gerrit.wikimedia.org/r/315664 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7af340856e89c006e0cf62e58c8a15abbac5ada Gerrit-PatchSet: 6 Gerrit-Project: analytics/mediawiki-storage Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> Gerrit-Reviewer: Hashar <has...@free.fr> Gerrit-Reviewer: Mforns <mfo...@wikimedia.org> Gerrit-Reviewer: Milimetric <dandree...@wikimedia.org> Gerrit-Reviewer: Nuria <nu...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits