Skip to content

Commit 2c318bd

Browse files
committed
test: switching from mustache to handlebars
1 parent 30be5bc commit 2c318bd

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

packages/core/test/pattern_engines_tests.js

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,75 @@ var config = require('./util/patternlab-config.json');
88

99
patternEngines.loadAllEngines(config);
1010

11-
// the mustache test pattern, stolen from object_factory unit tests
12-
var mustacheTestPattern = new Pattern(
11+
// the handlebars test pattern, stolen from object_factory unit tests
12+
var handlebarsTestPattern = new Pattern(
1313
'source/_patterns/atoms/global/colors-alt.hbs',
1414
{ d: 123 }
1515
);
16-
var mustacheTestPseudoPatternBasePattern = new Pattern(
16+
var handlebarsTestPseudoPatternBasePattern = new Pattern(
1717
'source/_patterns/pages/homepage.hbs',
1818
{ d: 123 }
1919
);
20-
var mustacheTestPseudoPattern = new Pattern(
20+
var handlebarsTestPseudoPattern = new Pattern(
2121
'source/_patterns/pages/homepage~emergency.json',
2222
{ d: 123 }
2323
);
24-
mustacheTestPseudoPattern.isPseudoPattern = true;
25-
mustacheTestPseudoPattern.basePattern = mustacheTestPseudoPatternBasePattern;
24+
handlebarsTestPseudoPattern.isPseudoPattern = true;
25+
handlebarsTestPseudoPattern.basePattern =
26+
handlebarsTestPseudoPatternBasePattern;
2627
var engineNames = Object.keys(patternEngines);
2728

2829
tap.test(
29-
'getEngineNameForPattern returns "mustache" from test pattern',
30+
'getEngineNameForPattern returns "handlebars" from test pattern',
3031
function (test) {
31-
var engineName =
32-
patternEngines.getEngineNameForPattern(mustacheTestPattern);
33-
test.equal(engineName, 'mustache');
32+
var engineName = patternEngines.getEngineNameForPattern(
33+
handlebarsTestPattern
34+
);
35+
test.equal(engineName, 'handlebars');
3436
test.end();
3537
}
3638
);
3739

3840
tap.test(
39-
'getEngineNameForPattern returns "mustache" for a plain string template as a backwards compatibility measure',
41+
'getEngineNameForPattern returns "handlebars" for a plain string template as a backwards compatibility measure',
4042
function (test) {
4143
test.plan(1);
4244
test.equal(
4345
patternEngines.getEngineNameForPattern('plain text string'),
44-
'mustache'
46+
'handlebars'
4547
);
4648
test.end();
4749
}
4850
);
4951

5052
tap.test(
51-
'getEngineNameForPattern returns "mustache" for an artificial empty template',
53+
'getEngineNameForPattern returns "handlebars" for an artificial empty template',
5254
function (test) {
5355
test.plan(1);
5456
var emptyPattern = Pattern.createEmpty();
5557
test.equal(
5658
patternEngines.getEngineNameForPattern(emptyPattern),
57-
'mustache'
59+
'handlebars'
5860
);
5961
test.end();
6062
}
6163
);
6264

6365
tap.test(
64-
'getEngineForPattern returns a reference to the mustache engine from test pattern',
66+
'getEngineForPattern returns a reference to the handlebars engine from test pattern',
6567
function (test) {
66-
var engine = patternEngines.getEngineForPattern(mustacheTestPattern);
68+
var engine = patternEngines.getEngineForPattern(handlebarsTestPattern);
6769
test.equal(engine, patternEngines.hbs);
6870
test.end();
6971
}
7072
);
7173

7274
tap.test(
73-
'getEngineForPattern returns a reference to the mustache engine from test pseudo-pattern',
75+
'getEngineForPattern returns a reference to the handlebars engine from test pseudo-pattern',
7476
function (test) {
75-
var engine = patternEngines.getEngineForPattern(mustacheTestPseudoPattern);
77+
var engine = patternEngines.getEngineForPattern(
78+
handlebarsTestPseudoPattern
79+
);
7680
test.equal(engine, patternEngines.hbs);
7781
test.end();
7882
}
@@ -189,10 +193,10 @@ function testProps(object, propTests, test) {
189193
}
190194

191195
tap.test(
192-
'patternEngines object contains at least the default mustache engine',
196+
'patternEngines object contains at least the default handlebars engine',
193197
function (test) {
194198
test.plan(1);
195-
test.ok(patternEngines.hasOwnProperty('mustache'));
199+
test.ok(patternEngines.hasOwnProperty('handlebars'));
196200
test.end();
197201
}
198202
);

0 commit comments

Comments
 (0)