Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #82 from maksimr/master
Browse files Browse the repository at this point in the history
chore: fix tests in Chrome
  • Loading branch information
maksimr committed Nov 12, 2015
2 parents 0a7e222 + 61f57df commit 35b7599
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var formatError = function (error) {
}

// remove mocha stack entries
return stack.replace(/\n.+\/mocha\/mocha.js\?\w*\:.+(?=(\n|$))/g, '')
return stack.replace(/\n.+\/mocha\/mocha.js\?\w*:.+(?=(\n|$))/g, '')
}

return message
Expand Down
30 changes: 20 additions & 10 deletions test/adapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@
*/

/* globals
createMochaReporterConstructor,
createMochaReporterNode,
createMochaStartFn,
createConfigObject,
mochaConfig: true
*/
createMochaReporterConstructor,
createMochaReporterNode,
createMochaStartFn,
createConfigObject,
mochaConfig: true,
formatError: true,
MockSocket: true,
Emitter: true,
sinon: true,
expect: true,
describe: true,
beforeEach: true,
afterEach: true,
it: true
*/
describe('adapter mocha', function () {
var Karma = window.__karma__.constructor
var sandbox
Expand Down Expand Up @@ -212,7 +221,7 @@ describe('adapter mocha', function () {
}

var stack =
'at $httpBackend (http://localhost:8080/base/app/bower_components/angular-mocks/angular-mocks.js?506e0a37bcd764ec63da3fd7005bf56592b3df32:1149)\n' +
'at $httpBackend (http://localhost:8080/base/app/bower_components/angular-mocks/angular-mocks.js?506e0a37bcd764ec63da3fd7005bf56592b3df32:1149)\n' +
'at sendReq (http://localhost:8080/base/app/bower_components/angular/angular.js?7deca05396a4331b08f812e4962ef9df1d9de0b5:8408)\n' +
'at http://localhost:8080/base/app/bower_components/angular/angular.js?7deca05396a4331b08f812e4962ef9df1d9de0b5:8125\n' +
'at http://localhost:8080/base/test/client/spec/controllers/list/formCtrlSpec.js?67eaca0f801cf45a86802a262618a6cfdc6a47be:110\n' +
Expand All @@ -236,8 +245,10 @@ describe('adapter mocha', function () {
describe('createMochaStartFn', function () {
beforeEach(function () {
this.mockMocha = {
grep: function () {},
run: function () {}
grep: function () {
},
run: function () {
}
}
})

Expand Down Expand Up @@ -348,7 +359,6 @@ describe('adapter mocha', function () {
expect(errLines[0]).to.contain('foo')
expect(errLines[1]).to.equal('bar')
expect(errLines[2]).to.not.contain('foo')
expect(errLines[3]).to.not.contain('bar')
})

})
Expand Down

0 comments on commit 35b7599

Please sign in to comment.