1
1
"use strict" ;
2
2
/*eslint-disable no-shadow*/
3
3
4
- var test = require ( 'tape ' ) ;
4
+ var tap = require ( 'tap ' ) ;
5
5
var path = require ( 'path' ) ;
6
6
var pa = require ( '../core/lib/pattern_assembler' ) ;
7
7
var Pattern = require ( '../core/lib/object_factory' ) . Pattern ;
@@ -11,9 +11,10 @@ var eol = require('os').EOL;
11
11
// don't run these tests unless mustache is installed
12
12
var engineLoader = require ( '../core/lib/pattern_engines' ) ;
13
13
if ( ! engineLoader . mustache ) {
14
- test . only ( 'Mustache engine not installed, skipping tests.' , function ( test ) {
14
+ tap . test ( 'Mustache engine not installed, skipping tests.' , function ( test ) {
15
15
test . end ( ) ;
16
16
} ) ;
17
+ return ;
17
18
}
18
19
19
20
// fake pattern lab constructor:
@@ -121,27 +122,27 @@ function testFindPartialsWithPatternParameters(test, partialTests) {
121
122
}
122
123
123
124
124
- test ( 'find_pattern_partials finds one simple partial' , function ( test ) {
125
+ tap . test ( 'find_pattern_partials finds one simple partial' , function ( test ) {
125
126
testFindPartials ( test , [
126
127
"{{> molecules-comment-header}}"
127
128
] ) ;
128
129
} ) ;
129
130
130
- test ( 'find_pattern_partials finds simple partials under stressed circumstances' , function ( test ) {
131
+ tap . test ( 'find_pattern_partials finds simple partials under stressed circumstances' , function ( test ) {
131
132
testFindPartials ( test , [
132
133
"{{>molecules-comment-header}}" ,
133
134
"{{> " + eol + " molecules-comment-header" + eol + "}}" ,
134
135
"{{> molecules-weird-spacing }}"
135
136
] ) ;
136
137
} ) ;
137
138
138
- test ( 'find_pattern_partials finds one simple verbose partial' , function ( test ) {
139
+ tap . test ( 'find_pattern_partials finds one simple verbose partial' , function ( test ) {
139
140
testFindPartials ( test , [
140
141
'{{> 00-atoms/00-global/06-test }}'
141
142
] ) ;
142
143
} ) ;
143
144
144
- test ( 'find_pattern_partials finds partials with parameters' , function ( test ) {
145
+ tap . test ( 'find_pattern_partials finds partials with parameters' , function ( test ) {
145
146
testFindPartials ( test , [
146
147
"{{> molecules-single-comment(description: true) }}" ,
147
148
"{{> molecules-single-comment(description: 42) }}" ,
@@ -153,55 +154,55 @@ test('find_pattern_partials finds partials with parameters', function (test) {
153
154
] ) ;
154
155
} ) ;
155
156
156
- test ( 'find_pattern_partials finds simple partials with style modifiers' , function ( test ) {
157
+ tap . test ( 'find_pattern_partials finds simple partials with style modifiers' , function ( test ) {
157
158
testFindPartials ( test , [
158
159
'{{> molecules-single-comment:foo }}' ,
159
160
'{{> molecules-single-comment:foo|bar }}'
160
161
] ) ;
161
162
} ) ;
162
163
163
- test ( 'find_pattern_partials finds mixed partials' , function ( test ) {
164
+ tap . test ( 'find_pattern_partials finds mixed partials' , function ( test ) {
164
165
testFindPartials ( test , [
165
166
'{{> molecules-single-comment:foo(description: "test", anotherThing: true) }}' ,
166
167
'{{> molecules-single-comment:foo|bar(description: true) }}'
167
168
] ) ;
168
169
} ) ;
169
170
170
- test ( 'find_pattern_partials finds one simple partial with styleModifier' , function ( test ) {
171
+ tap . test ( 'find_pattern_partials finds one simple partial with styleModifier' , function ( test ) {
171
172
testFindPartialsWithStyleModifiers ( test , [
172
173
"{{> molecules-comment-header:test}}"
173
174
] ) ;
174
175
} ) ;
175
176
176
- test ( 'find_pattern_partials finds partial with many styleModifiers' , function ( test ) {
177
+ tap . test ( 'find_pattern_partials finds partial with many styleModifiers' , function ( test ) {
177
178
testFindPartialsWithStyleModifiers ( test , [
178
179
"{{> molecules-comment-header:test|test2|test3}}"
179
180
] ) ;
180
181
} ) ;
181
182
182
- test ( 'find_pattern_partials finds partials with differing styleModifiers' , function ( test ) {
183
+ tap . test ( 'find_pattern_partials finds partials with differing styleModifiers' , function ( test ) {
183
184
testFindPartialsWithStyleModifiers ( test , [
184
185
"{{> molecules-comment-header:test|test2|test3}}" ,
185
186
"{{> molecules-comment-header:foo-1}}" ,
186
187
"{{> molecules-comment-header:bar_1}}"
187
188
] ) ;
188
189
} ) ;
189
190
190
- test ( 'find_pattern_partials finds partials with styleModifiers when parameters present' , function ( test ) {
191
+ tap . test ( 'find_pattern_partials finds partials with styleModifiers when parameters present' , function ( test ) {
191
192
testFindPartialsWithStyleModifiers ( test , [
192
193
"{{> molecules-comment-header:test|test2|test3(description: true)}}" ,
193
194
"{{> molecules-comment-header:foo-1(description: 'foo')}}" ,
194
195
"{{> molecules-comment-header:bar_1(descrition: 'bar', anotherThing: 10102010) }}"
195
196
] ) ;
196
197
} ) ;
197
198
198
- test ( 'find_pattern_partials_with_parameters finds one simple partial with parameters' , function ( test ) {
199
+ tap . test ( 'find_pattern_partials_with_parameters finds one simple partial with parameters' , function ( test ) {
199
200
testFindPartialsWithPatternParameters ( test , [
200
201
"{{> molecules-comment-header(description: 'test')}}"
201
202
] ) ;
202
203
} ) ;
203
204
204
- test ( 'find_pattern_partials_with_parameters finds partials with parameters' , function ( test ) {
205
+ tap . test ( 'find_pattern_partials_with_parameters finds partials with parameters' , function ( test ) {
205
206
testFindPartialsWithPatternParameters ( test , [
206
207
"{{> molecules-single-comment(description: true) }}" ,
207
208
"{{> molecules-single-comment(description: 42) }}" ,
@@ -213,7 +214,7 @@ test('find_pattern_partials_with_parameters finds partials with parameters', fun
213
214
] ) ;
214
215
} ) ;
215
216
216
- test ( 'find_pattern_partials finds partials with parameters when styleModifiers present' , function ( test ) {
217
+ tap . test ( 'find_pattern_partials finds partials with parameters when styleModifiers present' , function ( test ) {
217
218
testFindPartialsWithPatternParameters ( test , [
218
219
"{{> molecules-comment-header:test|test2|test3(description: true)}}" ,
219
220
"{{> molecules-comment-header:foo-1(description: 'foo')}}" ,
0 commit comments