File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -225,13 +225,13 @@ not ok 1 test_add_no_numbers (tests.math_test.MathTest)
225225# AssertionError: 42 != 0 : Should return 0 with no params
2262261..1`
227227 expect ( parser ( example ) ) . toEqual ( {
228- ok : true ,
228+ ok : false ,
229229 passed : [ ] ,
230230 failed : [
231231 {
232232 message : 'add no numbers' ,
233233 details :
234- 'Traceback (most recent call last):\n Fail Message\nAssertionError: 42 != 0 : Should return 0 with no params' ,
234+ 'Traceback (most recent call last):\nFail Message\nAssertionError: 42 != 0 : Should return 0 with no params' ,
235235 } ,
236236 ] ,
237237 logs : [ ] ,
@@ -251,13 +251,13 @@ not ok 2 test_add_one_number (tests.math_test.MathTest)
2512511..2
252252`
253253 expect ( parser ( example ) ) . toEqual ( {
254- ok : true ,
254+ ok : false ,
255255 passed : [ { message : 'add no numbers' } ] ,
256256 failed : [
257257 {
258258 message : 'add one number' ,
259259 details :
260- 'Traceback (most recent call last):\n Fail Message\nAssertionError: 2 != 1 : Should add one number to 0' ,
260+ 'Traceback (most recent call last):\nFail Message\nAssertionError: 2 != 1 : Should add one number to 0' ,
261261 } ,
262262 ] ,
263263 logs : [ ] ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const r = {
2323 start : / ^ ( n o t o k ) | ( o k ) / ,
2424 fail : / ^ n o t o k (?< index > \d + ) \s ( \- \s ) ? (?< message > .+ ) $ / ,
2525 pass : / ^ o k (?< index > \d + ) \s ( \- \s ) ? (?< message > .+ ) $ / ,
26- details : / ^ # \s { 2 } (?< message > .+ ) $ / ,
26+ details : / ^ # \s { 1 , 2 } (?< message > .+ ) $ / ,
2727 ignore : / ^ ( 1 \. \. [ 0 - 9 ] + ) | ( # \s + ( t e s t s | p a s s | f a i l | s k i p ) \s + [ 0 - 9 ] + ) $ / ,
2828}
2929
@@ -75,7 +75,7 @@ const parser = (text: string): ParserOutput => {
7575 }
7676
7777 for ( const line of lines ) {
78- if ( ! line . length ) {
78+ if ( ! line . length || ! ! r . ignore . exec ( line ) ) {
7979 continue
8080 }
8181 // be optimistic! check for success first
@@ -121,11 +121,9 @@ const parser = (text: string): ParserOutput => {
121121 continue
122122 }
123123
124- if ( ! r . ignore . exec ( line ) ) {
125- // must be a log, associate with the next test
126- logs . push ( line )
127- result . logs . push ( line )
128- }
124+ // must be a log, associate with the next test
125+ logs . push ( line )
126+ result . logs . push ( line )
129127 }
130128 addCurrentDetails ( )
131129 return result
You can’t perform that action at this time.
0 commit comments