Skip to content

Commit

Permalink
Merge pull request #640 from kingofzeal/dev-3.0
Browse files Browse the repository at this point in the history
Fix broken unit test(s)
  • Loading branch information
bmuenzenmeyer committed Mar 21, 2017
2 parents 5f38775 + 1b74429 commit a0af839
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
3 changes: 3 additions & 0 deletions test/files/_patterns/00-test/00-foo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
state: inreview
---
## A Simple Include

This pattern contains an include of `test-bar`. It also has this markdown file, which does not have frontmatter.
2 changes: 1 addition & 1 deletion test/files/_patterns/00-test/01-bar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
status: complete
state: complete
---
## A Simple Bit of Markup

Expand Down
2 changes: 1 addition & 1 deletion test/files/_patterns/00-test/03-styled-atom.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
status: inprogress
state: inprogress
---
18 changes: 7 additions & 11 deletions test/lineage_hunter_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function createBasePatternLabObject() {
paths: {
source: {
patterns: patterns_dir
},
public: {
patterns: './test/public/_patterns'
}
},
outputFileSuffixes: {
Expand All @@ -48,6 +51,8 @@ function createBasePatternLabObject() {
pl.config.debug = false;
pl.patterns = [];
pl.partials = {};
pl.patternGroups = {};
pl.subtypePatterns = {};

return pl;
}
Expand Down Expand Up @@ -266,17 +271,8 @@ tap.test('cascade_pattern_states sets the pattern state on any lineage patterns
//arrange
var pl = createBasePatternLabObject();

var atomPattern = new of.Pattern('00-test/01-bar.mustache');
atomPattern.template = fs.readFileSync(pl.config.paths.source.patterns + '00-test/01-bar.mustache', 'utf8');
atomPattern.extendedTemplate = atomPattern.template;
atomPattern.patternState = "inreview";
pattern_assembler.addPattern(atomPattern, pl);

var consumerPattern = new of.Pattern('00-test/00-foo.mustache');
consumerPattern.template = fs.readFileSync(pl.config.paths.source.patterns + '00-test/00-foo.mustache', 'utf8');
consumerPattern.extendedTemplate = consumerPattern.template;
consumerPattern.patternState = "complete";
pattern_assembler.addPattern(consumerPattern, pl);
var atomPattern = pattern_assembler.load_pattern_iterative('00-test/01-bar.mustache', pl);
var consumerPattern = pattern_assembler.load_pattern_iterative('00-test/00-foo.mustache', pl);

lineage_hunter.find_lineage(consumerPattern, pl);

Expand Down
4 changes: 2 additions & 2 deletions test/markdown_parser_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tap.test('parses pattern description block correctly when frontmatter present',

//assert
test.equals(returnObject.markdown, '<h2>A Simple Bit of Markup</h2>\n<p>Foo cannot get simpler than bar, amiright?</p>\n');
test.equals(returnObject.status, 'complete');
test.equals(returnObject.state, 'complete');
test.end();
});

Expand All @@ -45,6 +45,6 @@ tap.test('parses frontmatter only when no markdown present', function (test) {

//assert
test.equals(returnObject.markdown, '');
test.equals(returnObject.status, 'inprogress');
test.equals(returnObject.state, 'inprogress');
test.end();
});

0 comments on commit a0af839

Please sign in to comment.