Skip to content

Commit

Permalink
PhantomJS 2. Fixes #34
Browse files Browse the repository at this point in the history
- got new libraries and some of the updates from upstream
- added test on Funciton.prototype.bind
- misc updates in README.md and other files
  • Loading branch information
givankin committed Oct 7, 2016
2 parents 3b5e1c4 + 392bf5f commit f9c172f
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 163 deletions.
10 changes: 10 additions & 0 deletions HISTORY.md
@@ -1,5 +1,15 @@
# History

## 1.0.0
* Bump mocha to 2.4.5
* [BREAKING] Bump grunt-lib-phantomjs to master, uses PhantomJS 2.x
* [BREAKING] `run` option is now true by default

## 0.4.11
* Bump mocha to 1.18 for promise support
* README fixes
* `options.growlOnSuccess` option added (@naganowl)

## 0.4.10
* Actually error out if `logErrors` is true and error

Expand Down
11 changes: 2 additions & 9 deletions README.md
Expand Up @@ -26,7 +26,7 @@ This plugin, however:

## Parent Plugin

This plugin is based on [kmiyashiro/grunt-mocha](https://github.com/kmiyashiro/grunt-mocha/tree/8e72249b1042a270641633a69725ccf63fa10259) v0.4.10 and supports all the
This plugin is based on [kmiyashiro/grunt-mocha](https://github.com/kmiyashiro/grunt-mocha/tree/8e72249b1042a270641633a69725ccf63fa10259) v1.0.2 and supports most of the
configurations of that plugin as of that version. Please see that repo for more options on configuration.

Changes from the upstream plugin will be merged periodically.
Expand All @@ -49,18 +49,12 @@ grunt.loadNpmTasks('grunt-blanket-mocha');
## Dependencies

* Blanket.js (tested with v1.1.6)
* Mocha (tested with v2.0.1)
* Mocha (tested with v2.4.5)

## The "blanket_mocha" task

### See Also

This plugin is based off of grunt-contrib-mocha. For general config options and examples, please see that repo.

## Setup

### Demo

See the `example` and `example-requires` directories for a fully-working examples of the setup, including some of the scaffolding required to get all the pieces to fit together. The `README` in that directory will walk you through it.

### Gruntfile
Expand All @@ -84,7 +78,6 @@ Use the `all` param to specify where your mocha browser spec HTML file lives.
This works the same way as it does in the base `grunt-mocha` plugin.

NOTE: Be sure to include the blanketJS script tag in your test html file

### Blanket Adapter

To allow Blanket to communicate with the parent Grunt process, add this snippet in your test HTML, after all the
Expand Down
6 changes: 3 additions & 3 deletions example-requirejs/package.json
Expand Up @@ -7,17 +7,17 @@
"name": "Dave Cadwallader",
"email": "dcadwallader@gmail.com"
},
"contributors": {
"contributors": [{
"name": "Sean Coker",
"email": "hello@sean.is",
"url": "http://sean.is"
},
}],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"devDependencies": {
"grunt-blanket-mocha": "0.4.2",
"grunt-blanket-mocha": "0.5.0",
"grunt": "0.4.1",
"mocha": "2.0.1",
"chai": "1.8.1",
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Expand Up @@ -7,17 +7,17 @@
"name": "Dave Cadwallader",
"email": "dcadwallader@gmail.com"
},
"contributors": {
"contributors": [{
"name": "Sean Coker",
"email": "hello@sean.is",
"url": "http://sean.is"
},
}],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"devDependencies": {
"grunt-blanket-mocha": "0.4.2",
"grunt-blanket-mocha": "0.5.0",
"grunt": "0.4.1",
"mocha": "2.0.1",
"chai": "1.8.1",
Expand Down
1 change: 1 addition & 0 deletions example/test.html
Expand Up @@ -33,6 +33,7 @@
<script src="test/math/subtraction-specs.js"></script>
<script src="test/spelling/plurals-specs.js"></script>
<script src="test/spelling/vowels-specs.js"></script>
<script src="test/binding-specs.js"></script>

</head>
<body>
Expand Down
15 changes: 15 additions & 0 deletions example/test/binding-specs.js
@@ -0,0 +1,15 @@
// This confirms we're using PhantomJS 2
describe("Function.prototype.bind test", function() {

it("should be available natively", function() {
expect(Function.prototype.bind).to.be.a('function');
});

it("should actually bind", function() {
function addTwoToThis() {
return this + 2;
}
expect(addTwoToThis.bind(7)()).to.equal(9);
});

});
23 changes: 0 additions & 23 deletions example/test/test-loader.js

This file was deleted.

8 changes: 0 additions & 8 deletions example/test/test-suite.js

This file was deleted.

29 changes: 15 additions & 14 deletions package.json
@@ -1,51 +1,52 @@
{
"name": "grunt-blanket-mocha",
"description": "Headless Blanket.js code coverage and Mocha testing via PhantomJS",
"version": "0.5.0",
"version": "0.6.0",
"homepage": "https://github.com/ModelN/grunt-blanket-mocha",
"author": {
"name": "Dave Cadwallader",
"email": "dcadwallader@gmail.com",
"url": "http://geekdave.com"
},
"contributors": {
"contributors": [{
"name": "Sean Coker",
"email": "hello@sean.is",
"url": "http://sean.is"
},
}],
"repository": {
"type": "git",
"url": "git://github.com/ModelN/grunt-blanket-mocha.git"
"url": "git://github.com/GruntBlanketMocha/grunt-blanket-mocha.git"
},
"bugs": {
"url": "https://github.com/ModelN/grunt-blanket-mocha/issues"
"url": "https://github.com/GruntBlanketMocha/grunt-blanket-mocha/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/ModelN/grunt-blanket-mocha/blob/master/LICENSE-MIT"
"url": "https://github.com/GruntBlanketMocha/grunt-blanket-mocha/blob/master/LICENSE-MIT"
}
],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "./node_modules/.bin/grunt test"
"test": "grunt test"
},
"dependencies": {
"grunt": ">=0.4.0",
"blanket": "~1.1.6",
"grunt-lib-phantomjs": "~0.6.0",
"mocha": "~2.0.1",
"lodash": "~2.4.1"
"grunt-lib-phantomjs": "^1.0.2",
"mocha": "^2.4.5",
"lodash": "^3.9.0"
},
"peerDependencies": {
"grunt": "~0.4"
"grunt": ">=0.4.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-jshint": "~0.7.1"
"chai": "^3.4.1",
"grunt-contrib-connect": "~1.0.2",
"grunt-contrib-jshint": "~1.0.0"
},
"keywords": [
"gruntplugin",
Expand Down

0 comments on commit f9c172f

Please sign in to comment.