Skip to content
Browse files

Merge pull request #21 from kpdecker/ut-fixup

Fix unit tests under new versions of mocha
  • Loading branch information...
2 parents 181bfa9 + ad643f6 commit df8376f397d10d18c6db0d4260e91316ccc350c5 @metaskills metaskills committed
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

0 comments on commit df8376f

Please sign in to comment.
Something went wrong with that request. Please try again.