Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Commit

Permalink
Adding a connect:tests task, to automatically open tests in the defau…
Browse files Browse the repository at this point in the history
…lt browser.

Updating grunt-contrib-connect.
  • Loading branch information
carhartl committed May 9, 2014
1 parent da0e4ac commit 1f14c00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -39,11 +39,9 @@ You should see a green message in the console:
You can also run the tests in the browser.
Start a test server from the project root:

$ grunt connect:server:keepalive
$ grunt connect:tests

Open the following URL in a browser:

$ open http://127.0.0.1:9999/test/index.html
This will automatically open the tests at http://127.0.0.1:9998/test/index.html in the default browser.

_Note: we recommend cleaning all the browser cookies before running the tests, that can avoid false positive failures._

Expand Down
17 changes: 14 additions & 3 deletions Gruntfile.js
Expand Up @@ -49,12 +49,23 @@ module.exports = function (grunt) {
}
},
connect: {
server: {
all: {
options: {
base: '.',
directory: 'test',
directory: 'test'
}
},
saucelabs: {
options: {
port: 9999
}
},
tests: {
options: {
open: 'http://127.0.0.1:9998/test/index.html',
keepalive: true,
port: 9998
}
}
},
'saucelabs-qunit': {
Expand Down Expand Up @@ -160,6 +171,6 @@ module.exports = function (grunt) {
}

grunt.registerTask('default', ['jshint', 'qunit', 'uglify', 'compare_size']);
grunt.registerTask('saucelabs', ['connect', 'saucelabs-qunit']);
grunt.registerTask('saucelabs', ['connect:saucelabs', 'saucelabs-qunit']);
grunt.registerTask('ci', ['jshint', 'qunit', 'saucelabs']);
};
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -25,7 +25,7 @@
"grunt-contrib-watch": "~0.3.0",
"grunt-compare-size": "~0.4.0",
"grunt-saucelabs": "~4.1.1",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-connect": "~0.7.1",
"gzip-js": "~0.3.0"
},
"volo": {
Expand Down

0 comments on commit 1f14c00

Please sign in to comment.