Skip to content

Commit

Permalink
fix(transform) Add templatemark -> markdown_template test
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Aug 31, 2020
1 parent 9fefb45 commit 09cb2d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
12 changes: 8 additions & 4 deletions packages/markdown-transform/test/data/acceptance/grammar.tem.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# Heading
Heading
====

And below is a **clause**.

{{#clause deliveryClause}}
## Acceptance of Delivery.
Acceptance of Delivery.
----

{{shipper}} will be deemed to have completed its delivery obligations
if in {{receiver}}'s opinion, the {{deliverable}} satisfies the
Acceptance Criteria, and {{receiver}} notifies {{shipper}} in writing
that it is accepting the {{deliverable}}.

## Inspection and Notice.
Inspection and Notice.
----

{{receiver}} will have {{businessDays}} Business Days to inspect and
evaluate the {{deliverable}} on the delivery date before notifying
{{shipper}} that it is either accepting or rejecting the
{{deliverable}}.

## Acceptance Criteria.
Acceptance Criteria.
----

The "Acceptance Criteria" are the specifications the {{deliverable}}
must meet for the {{shipper}} to comply with its requirements and
Expand Down

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/markdown-transform/test/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function normalizeNLs(input) {

// Acceptance test
const acceptanceGrammarFile = path.resolve(__dirname, 'data/acceptance', 'grammar.tem.md');
const acceptanceGrammar = fs.readFileSync(acceptanceGrammarFile, 'utf8');
const acceptanceGrammar = normalizeNLs(fs.readFileSync(acceptanceGrammarFile, 'utf8'));
const acceptanceGrammarTokens = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'data/acceptance', 'grammar_tokens.json'), 'utf8'));
const acceptanceModelFile = path.resolve(__dirname, 'data/acceptance', 'model.cto');
const acceptanceTemplateMark = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'data/acceptance', 'grammar.json'), 'utf8'));
Expand Down Expand Up @@ -78,6 +78,11 @@ describe('#acceptance', () => {
const result = await transform(acceptanceGrammar, 'markdown_template', ['templatemark'], parameters);
result.should.deep.equal(acceptanceTemplateMark);
});

it('templatemark -> markdown_template', async () => {
const result = await transform(acceptanceTemplateMark, 'templatemark', ['markdown_template'], parameters);
result.should.deep.equal(acceptanceGrammar);
});
});

describe('#markdown', () => {
Expand Down
Binary file modified packages/markdown-transform/transformations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09cb2d1

Please sign in to comment.