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 handlebars is installed
12
12
var engineLoader = require ( '../core/lib/pattern_engines' ) ;
13
13
if ( ! engineLoader . handlebars ) {
14
- test . only ( 'Handlebars engine not installed, skipping tests.' , function ( test ) {
15
- test . end ( ) ;
16
- } ) ;
14
+ tap . test ( 'Handlebars engine not installed, skipping tests.' , function ( test ) {
15
+ test . end ( )
16
+ } )
17
+ return
17
18
} ;
18
19
19
20
// fake pattern lab constructor:
@@ -69,7 +70,7 @@ function testFindPartials(test, partialTests) {
69
70
test . end ( ) ;
70
71
}
71
72
72
- test ( 'hello world handlebars pattern renders' , function ( test ) {
73
+ tap . test ( 'hello world handlebars pattern renders' , function ( test ) {
73
74
test . plan ( 1 ) ;
74
75
75
76
var patternPath = path . join ( '00-atoms' , '00-global' , '00-helloworld.hbs' ) ;
@@ -84,7 +85,7 @@ test('hello world handlebars pattern renders', function (test) {
84
85
test . end ( ) ;
85
86
} ) ;
86
87
87
- test ( 'hello worlds handlebars pattern can see the atoms-helloworld partial and renders it twice' , function ( test ) {
88
+ tap . test ( 'hello worlds handlebars pattern can see the atoms-helloworld partial and renders it twice' , function ( test ) {
88
89
test . plan ( 1 ) ;
89
90
90
91
// pattern paths
@@ -106,7 +107,7 @@ test('hello worlds handlebars pattern can see the atoms-helloworld partial and r
106
107
test . end ( ) ;
107
108
} ) ;
108
109
109
- test ( 'handlebars partials can render JSON values' , function ( test ) {
110
+ tap . test ( 'handlebars partials can render JSON values' , function ( test ) {
110
111
test . plan ( 1 ) ;
111
112
112
113
// pattern paths
@@ -125,7 +126,7 @@ test('handlebars partials can render JSON values', function (test) {
125
126
test . end ( ) ;
126
127
} ) ;
127
128
128
- test ( 'handlebars partials use the JSON environment from the calling pattern and can accept passed parameters' , function ( test ) {
129
+ tap . test ( 'handlebars partials use the JSON environment from the calling pattern and can accept passed parameters' , function ( test ) {
129
130
test . plan ( 1 ) ;
130
131
131
132
// pattern paths
@@ -147,7 +148,7 @@ test('handlebars partials use the JSON environment from the calling pattern and
147
148
test . end ( ) ;
148
149
} ) ;
149
150
150
- test ( 'find_pattern_partials finds partials' , function ( test ) {
151
+ tap . test ( 'find_pattern_partials finds partials' , function ( test ) {
151
152
testFindPartials ( test , [
152
153
"{{> molecules-comment-header}}" ,
153
154
"{{> molecules-comment-header}}" ,
@@ -157,7 +158,7 @@ test('find_pattern_partials finds partials', function (test) {
157
158
] ) ;
158
159
} ) ;
159
160
160
- test ( 'find_pattern_partials finds verbose partials' , function ( test ) {
161
+ tap . test ( 'find_pattern_partials finds verbose partials' , function ( test ) {
161
162
testFindPartials ( test , [
162
163
'{{> 01-molecules/06-components/03-comment-header.hbs }}' ,
163
164
"{{> 01-molecules/06-components/02-single-comment.hbs(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}" ,
@@ -168,20 +169,20 @@ test('find_pattern_partials finds verbose partials', function (test) {
168
169
] ) ;
169
170
} ) ;
170
171
171
- test ( 'find_pattern_partials finds simple partials with parameters' , function ( test ) {
172
+ tap . test ( 'find_pattern_partials finds simple partials with parameters' , function ( test ) {
172
173
testFindPartials ( test , [
173
174
"{{> molecules-single-comment(description: 'A life isn\'t like a garden. Perfect moments can be had, but not preserved, except in memory.') }}" ,
174
175
'{{> molecules-single-comment(description:"A life is like a \"garden\". Perfect moments can be had, but not preserved, except in memory.") }}'
175
176
] ) ;
176
177
} ) ;
177
178
178
- test ( 'find_pattern_partials finds simple partials with style modifiers' , function ( test ) {
179
+ tap . test ( 'find_pattern_partials finds simple partials with style modifiers' , function ( test ) {
179
180
testFindPartials ( test , [
180
181
'{{> molecules-single-comment:foo }}'
181
182
] ) ;
182
183
} ) ;
183
184
184
- test ( 'find_pattern_partials finds partials with handlebars parameters' , function ( test ) {
185
+ tap . test ( 'find_pattern_partials finds partials with handlebars parameters' , function ( test ) {
185
186
testFindPartials ( test , [
186
187
'{{> atoms-title title="bravo" headingLevel="2" headingSize="bravo" position="left"}}' ,
187
188
'{{> atoms-title title="bravo"' + eol + ' headingLevel="2"' + eol + ' headingSize="bravo"' + eol + ' position="left"}}' ,
@@ -194,7 +195,7 @@ test('find_pattern_partials finds partials with handlebars parameters', function
194
195
] ) ;
195
196
} ) ;
196
197
197
- test ( 'find_pattern_partials finds handlebars block partials' , function ( test ) {
198
+ tap . test ( 'find_pattern_partials finds handlebars block partials' , function ( test ) {
198
199
testFindPartials ( test , [
199
200
'{{#> myPartial }}'
200
201
] ) ;
0 commit comments