11"use strict" ;
22/*eslint-disable no-shadow*/
33
4- var test = require ( 'tape ' ) ;
4+ var tap = require ( 'tap ' ) ;
55var path = require ( 'path' ) ;
66var pa = require ( '../core/lib/pattern_assembler' ) ;
77var Pattern = require ( '../core/lib/object_factory' ) . Pattern ;
@@ -11,9 +11,10 @@ var eol = require('os').EOL;
1111// don't run these tests unless handlebars is installed
1212var engineLoader = require ( '../core/lib/pattern_engines' ) ;
1313if ( ! 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
1718} ;
1819
1920// fake pattern lab constructor:
@@ -69,7 +70,7 @@ function testFindPartials(test, partialTests) {
6970 test . end ( ) ;
7071}
7172
72- test ( 'hello world handlebars pattern renders' , function ( test ) {
73+ tap . test ( 'hello world handlebars pattern renders' , function ( test ) {
7374 test . plan ( 1 ) ;
7475
7576 var patternPath = path . join ( '00-atoms' , '00-global' , '00-helloworld.hbs' ) ;
@@ -84,7 +85,7 @@ test('hello world handlebars pattern renders', function (test) {
8485 test . end ( ) ;
8586} ) ;
8687
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 ) {
8889 test . plan ( 1 ) ;
8990
9091 // pattern paths
@@ -106,7 +107,7 @@ test('hello worlds handlebars pattern can see the atoms-helloworld partial and r
106107 test . end ( ) ;
107108} ) ;
108109
109- test ( 'handlebars partials can render JSON values' , function ( test ) {
110+ tap . test ( 'handlebars partials can render JSON values' , function ( test ) {
110111 test . plan ( 1 ) ;
111112
112113 // pattern paths
@@ -125,7 +126,7 @@ test('handlebars partials can render JSON values', function (test) {
125126 test . end ( ) ;
126127} ) ;
127128
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 ) {
129130 test . plan ( 1 ) ;
130131
131132 // pattern paths
@@ -147,7 +148,7 @@ test('handlebars partials use the JSON environment from the calling pattern and
147148 test . end ( ) ;
148149} ) ;
149150
150- test ( 'find_pattern_partials finds partials' , function ( test ) {
151+ tap . test ( 'find_pattern_partials finds partials' , function ( test ) {
151152 testFindPartials ( test , [
152153 "{{> molecules-comment-header}}" ,
153154 "{{> molecules-comment-header}}" ,
@@ -157,7 +158,7 @@ test('find_pattern_partials finds partials', function (test) {
157158 ] ) ;
158159} ) ;
159160
160- test ( 'find_pattern_partials finds verbose partials' , function ( test ) {
161+ tap . test ( 'find_pattern_partials finds verbose partials' , function ( test ) {
161162 testFindPartials ( test , [
162163 '{{> 01-molecules/06-components/03-comment-header.hbs }}' ,
163164 "{{> 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) {
168169 ] ) ;
169170} ) ;
170171
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 ) {
172173 testFindPartials ( test , [
173174 "{{> molecules-single-comment(description: 'A life isn\'t like a garden. Perfect moments can be had, but not preserved, except in memory.') }}" ,
174175 '{{> molecules-single-comment(description:"A life is like a \"garden\". Perfect moments can be had, but not preserved, except in memory.") }}'
175176 ] ) ;
176177} ) ;
177178
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 ) {
179180 testFindPartials ( test , [
180181 '{{> molecules-single-comment:foo }}'
181182 ] ) ;
182183} ) ;
183184
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 ) {
185186 testFindPartials ( test , [
186187 '{{> atoms-title title="bravo" headingLevel="2" headingSize="bravo" position="left"}}' ,
187188 '{{> 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
194195 ] ) ;
195196} ) ;
196197
197- test ( 'find_pattern_partials finds handlebars block partials' , function ( test ) {
198+ tap . test ( 'find_pattern_partials finds handlebars block partials' , function ( test ) {
198199 testFindPartials ( test , [
199200 '{{#> myPartial }}'
200201 ] ) ;
0 commit comments