File tree 4 files changed +4
-3
lines changed
4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 9
9
* add(10, 20)
10
10
* // => 30
11
11
* add(10, 50) // => 60
12
+ * 10 + add(10, 50) // => 70
12
13
*/
13
14
14
15
function add ( x , y ) {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ exports.toJsdocRegister = function jsdoctest$toJsdocRegister(comment) {
93
93
var compiled = _ . map ( comment . examples , function ( example ) {
94
94
var id = baseId + example . testCase + ' => ' + example . expectedResult ;
95
95
var fn = 'function() {' +
96
- example . testCase + '.should.equal(' + example . expectedResult + ');' +
96
+ '(' + example . testCase + ') .should.equal(' + example . expectedResult + ');' +
97
97
'}' ;
98
98
return '__registerTest(\'' + id + '\', ' + fn + ');' ;
99
99
} ) . join ( '' ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ exports.commentToMochaSpec = function commentToMochaSpec(comment) {
48
48
return '\ndescribe(\'' + ctx . string + '\', function() {' +
49
49
_ . map ( comment . examples , function ( example ) {
50
50
return 'it(\'' + example . testCase + '\', function() {' +
51
- example . testCase +
51
+ '(' + example . testCase + ')' +
52
52
'.should.eql(' + example . expectedResult + ');' +
53
53
'});' ;
54
54
} ) . join ( '\n' ) +
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ describe('jsdoctest/mocha', function() {
17
17
content . should . containEql (
18
18
'\ndescribe(\'add()\', function() {' +
19
19
'it(\'add(1, 2)\', function() {' +
20
- 'add(1, 2).should.eql(3);' +
20
+ '( add(1, 2) ).should.eql(3);' +
21
21
'});' +
22
22
'});'
23
23
) ;
You can’t perform that action at this time.
0 commit comments