Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken unit test(s) #640

Merged
merged 1 commit into from
Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
});