Skip to content

Commit bb33968

Browse files
committed
fix test
1 parent 7a6ae42 commit bb33968

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

karma.conf.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = function (config) {
2+
config.set({
3+
frameworks: ['mocha', 'power-assert'],
4+
5+
files: [
6+
'test/*.js'
7+
],
8+
9+
client: {
10+
assert: {
11+
output: {
12+
maxDepth: 2
13+
}
14+
}
15+
},
16+
17+
preprocessors: {
18+
'test/**/*.spec.js': ['espower']
19+
},
20+
21+
browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],
22+
23+
singleRun: true
24+
})
25+
}

test/adapter.spec.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
describe('client.assert', function() {
2+
var orininalAssert = assert;
3+
4+
describe('.output.maxDepth', function () {
5+
beforeEach('put fixtures', function () {
6+
this.foo = {flag: true};
7+
this.bar = {}
8+
})
9+
10+
afterEach(function () {
11+
assert = orininalAssert;
12+
})
13+
14+
it('should be 2 as the customized value in karma.conf.js', function () {
15+
var expected = [this.foo]
16+
var actual = [this.bar]
17+
try {
18+
assert.deepEqual(expected, actual)
19+
} catch (e) {
20+
var error = e.message
21+
var message = [
22+
' # adapter.spec.js:18',
23+
' ',
24+
' assert.deepEqual(expected, actual)',
25+
' | | ',
26+
' | [Object{}]',
27+
' [Object{flag:true}]',
28+
''
29+
].join('\n') + ' '
30+
assert.deepEqual(error, message)
31+
}
32+
})
33+
})
34+
})

0 commit comments

Comments
 (0)