Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'dev' of github.com:mwaylabs/generator-m-ionic into dev
Browse files Browse the repository at this point in the history
* 'dev' of github.com:mwaylabs/generator-m-ionic:
  Updated gulp commands to use optional conf param; Updated readme file.
  • Loading branch information
gruppjo committed Feb 8, 2017
2 parents a12de8b + 27c22fe commit 7664ecf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/guides/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ gulp protractor
```
**Hint**: `gulp watch` and `gulp protractor` should not be run at the same time, this will yield unexpected and weird results. Make sure to run them separately!

**Advanced**: You can start both commands with optional parameter `--conf=configfile.js`. So in case you have different setup configurations, you can run
`gulp karma --conf='karma.extra.conf.js'` or `gulp protractor --conf='protractor.ios.conf.js'`.


### Karma and Jasmine for unit tests
In addition to providing [Karma](http://karma-runner.github.io/) as a task runner for your unit tests our setup is configured to use [Jasmine](http://jasmine.github.io/) as a testing framework. This is done in the `karma.conf.js`. There are other options besides Jasmine but since Protractor is using it too, it's the simplest just to write your unit tests with Jasmine as well.
Expand Down
5 changes: 3 additions & 2 deletions generators/app/templates/gulp/testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ var bs = require('browser-sync');

// KARMA
function runKarma (singleRun, done) {
var confFile = options.conf ? options.conf : 'karma.conf.js';
new Server({
configFile: path.join(__dirname, '/../karma.conf.js'),
configFile: path.join(__dirname, '/../' + confFile),
singleRun: singleRun,
autoWatch: !singleRun
}, done).start();
Expand All @@ -35,7 +36,7 @@ gulp.task('webdriver-standalone', $.protractor.webdriver_standalone);
function runProtractor (done) {
gulp.src(paths.protractor)
.pipe($.protractor.protractor({
configFile: 'protractor.conf.js'
configFile: options.conf ? options.conf : 'protractor.conf.js'
}))
.on('error', function (err) {
// Make sure failed tests cause gulp to exit non-zero
Expand Down

0 comments on commit 7664ecf

Please sign in to comment.