Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix unit tests under new versions of mocha #21

Merged
merged 1 commit into from

2 participants

@kpdecker
Collaborator

Fixes failing unit tests due to changed output char in mocha

@metaskills metaskills merged commit df8376f into metaskills:master
@metaskills
Owner

Just merged this. Thanks! Will take a look at the others shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 20, 2012
  1. @kpdecker
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +1 −1  test/lib/mocha-phantomjs.js
  2. +6 −6 test/src/mocha-phantomjs.coffee
View
2  test/lib/mocha-phantomjs.js
@@ -63,7 +63,7 @@
describe('spec', function() {
var failComplete, failRegExp, passComplete, passRegExp, pendComplete, skipRegExp;
passRegExp = function(n) {
- return RegExp("\\u001b\\[32m\\s\\s\\u001b\\[0m\\u001b\\[90m\\spasses\\s" + n);
+ return RegExp("\\u001b\\[32m\\s\\s[✔✓]\\u001b\\[0m\\u001b\\[90m\\spasses\\s" + n);
};
skipRegExp = function(n) {
return RegExp("\\u001b\\[36m\\s\\s-\\sskips\\s" + n + "\\u001b\\[0m");
View
12 test/src/mocha-phantomjs.coffee
@@ -4,7 +4,7 @@ describe 'mocha-phantomjs', ->
spawn = require('child_process').spawn
fileURL = (file) -> "file://#{process.cwd()}/test/#{file}.html"
-
+
before ->
@runner = (done, args, callback) ->
stdout = ''
@@ -12,7 +12,7 @@ describe 'mocha-phantomjs', ->
mochaPhantomJS = spawn "#{process.cwd()}/bin/mocha-phantomjs", args
mochaPhantomJS.stdout.on 'data', (data) -> stdout = stdout.concat data.toString()
mochaPhantomJS.stderr.on 'data', (data) -> stderr = stderr.concat data.toString()
- mochaPhantomJS.on 'exit', (code) ->
+ mochaPhantomJS.on 'exit', (code) ->
callback?(code, stdout, stderr)
done?()
@@ -44,8 +44,8 @@ describe 'mocha-phantomjs', ->
expect(stdout).to.equal "Failed to start mocha.\n"
describe 'spec', ->
-
- passRegExp = (n) -> ///\u001b\[32m\s\s\u001b\[0m\u001b\[90m\spasses\s#{n}///
+
+ passRegExp = (n) -> ///\u001b\[32m\s\s[✔✓]\u001b\[0m\u001b\[90m\spasses\s#{n}///
skipRegExp = (n) -> ///\u001b\[36m\s\s-\sskips\s#{n}\u001b\[0m///
failRegExp = (n) -> ///\u001b\[31m\s\s#{n}\)\sfails\s#{n}\u001b\[0m///
passComplete = (n) -> ///\u001b\[0m\n\n\n\u001b\[92m\s\s\u001b\[0m\u001b\[32m\s#{n}\stests\scomplete///
@@ -79,7 +79,7 @@ describe 'mocha-phantomjs', ->
expect(stdout).to.match pendComplete(3)
describe 'failing', ->
-
+
###
$ ./bin/mocha-phantomjs test/failing.html
$ mocha -r chai/chai.js -R spec --globals chai.expect test/lib/failing.js
@@ -139,7 +139,7 @@ describe 'mocha-phantomjs', ->
expect(stdout).to.match /\u001b\[90m\․\u001b\[0m/ # grey
expect(stdout).to.match /\u001b\[36m\․\u001b\[0m/ # cyan
expect(stdout).to.match /\u001b\[31m\․\u001b\[0m/ # red
-
+
###
$ ./bin/mocha-phantomjs test/many.html dot
$ mocha -r chai/chai.js -R dot --globals chai.expect test/lib/many.js
Something went wrong with that request. Please try again.