@@ -18,7 +18,7 @@ Cucumber.DOMFormatter = function(rootNode) {
18
18
this . uri = function ( uri ) {
19
19
currentUri = uri ;
20
20
}
21
-
21
+
22
22
this . feature = function ( feature ) {
23
23
prepareAndPrintCurrentNode ( feature , { parentNode : rootNode , className : 'feature' , heading : '<h1>' } ) ;
24
24
featureElementsNode = currentNode . find ( '.childrenElements' ) ;
@@ -47,27 +47,27 @@ Cucumber.DOMFormatter = function(rootNode) {
47
47
printExamples ( step . multiline_arg . value , false ) ;
48
48
}
49
49
}
50
-
50
+
51
51
this . examples = function ( examples ) {
52
52
prepareAndPrintCurrentNode ( examples , { parentNode : featureElementsNode , className : 'exampleBlock' , heading : '<h2>' } ) ;
53
53
printExamples ( examples . rows , true ) ;
54
54
}
55
-
55
+
56
56
var prepareScenarioElementsNode = function ( ) {
57
57
scenarioElementsNode = currentNode . find ( '.childrenElements' ) ;
58
58
scenarioElementsNode . addClass ( 'steps' ) ;
59
59
}
60
-
60
+
61
61
var prepareAndPrintCurrentNode = function ( statement , nodeInfo ) {
62
62
currentNode = $ ( '#templates .blockelement' ) . clone ( ) . appendTo ( nodeInfo . parentNode ) ;
63
63
currentNode . addClass ( nodeInfo . className ) ;
64
64
printStatement ( statement , nodeInfo . heading ) ;
65
65
}
66
-
66
+
67
67
var hasExamples = function ( step ) {
68
68
return step . multiline_arg !== undefined && step . multiline_arg . type === 'table' ;
69
69
}
70
-
70
+
71
71
var printExamples = function ( examples , hasHeader ) {
72
72
var table = $ ( '#templates .examples' ) . clone ( ) . appendTo ( currentNode . find ( '.childrenElements' ) ) ;
73
73
$ . each ( examples , function ( index , example ) {
@@ -79,7 +79,7 @@ Cucumber.DOMFormatter = function(rootNode) {
79
79
printExampleRow ( node , example ) ;
80
80
} ) ;
81
81
}
82
-
82
+
83
83
var printExampleRow = function ( node , example ) {
84
84
var tr = $ ( '<tr>' ) . appendTo ( node ) ;
85
85
tr . attr ( 'id' , Cucumber . encodeId ( currentUri , example . line ) ) ;
@@ -105,7 +105,7 @@ Cucumber.DOMFormatter = function(rootNode) {
105
105
}
106
106
107
107
Cucumber . Reporter = function ( ) {
108
- var idMatched ;
108
+ var idMatched ;
109
109
this . result = function ( result ) {
110
110
$ ( '#' + idMatched ) . addClass ( result . status ) ;
111
111
if ( result . error_message !== undefined ) {
@@ -116,3 +116,7 @@ Cucumber.Reporter = function() {
116
116
idMatched = Cucumber . encodeId ( match . uri , match . step . line ) ;
117
117
}
118
118
}
119
+
120
+ if ( typeof module !== 'undefined' ) {
121
+ module . exports = Cucumber ;
122
+ }
0 commit comments