Skip to content

Commit 09cb2d1

Browse files
committed
fix(transform) Add templatemark -> markdown_template test
Signed-off-by: Jerome Simeon <[email protected]>
1 parent 9fefb45 commit 09cb2d1

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

packages/markdown-transform/test/data/acceptance/grammar.tem.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
# Heading
1+
Heading
2+
====
23

34
And below is a **clause**.
45

56
{{#clause deliveryClause}}
6-
## Acceptance of Delivery.
7+
Acceptance of Delivery.
8+
----
79

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

13-
## Inspection and Notice.
15+
Inspection and Notice.
16+
----
1417

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

20-
## Acceptance Criteria.
23+
Acceptance Criteria.
24+
----
2125

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

packages/markdown-transform/test/data/acceptance/grammar_tokens.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/markdown-transform/test/transform.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function normalizeNLs(input) {
4040

4141
// Acceptance test
4242
const acceptanceGrammarFile = path.resolve(__dirname, 'data/acceptance', 'grammar.tem.md');
43-
const acceptanceGrammar = fs.readFileSync(acceptanceGrammarFile, 'utf8');
43+
const acceptanceGrammar = normalizeNLs(fs.readFileSync(acceptanceGrammarFile, 'utf8'));
4444
const acceptanceGrammarTokens = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'data/acceptance', 'grammar_tokens.json'), 'utf8'));
4545
const acceptanceModelFile = path.resolve(__dirname, 'data/acceptance', 'model.cto');
4646
const acceptanceTemplateMark = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'data/acceptance', 'grammar.json'), 'utf8'));
@@ -78,6 +78,11 @@ describe('#acceptance', () => {
7878
const result = await transform(acceptanceGrammar, 'markdown_template', ['templatemark'], parameters);
7979
result.should.deep.equal(acceptanceTemplateMark);
8080
});
81+
82+
it('templatemark -> markdown_template', async () => {
83+
const result = await transform(acceptanceTemplateMark, 'templatemark', ['markdown_template'], parameters);
84+
result.should.deep.equal(acceptanceGrammar);
85+
});
8186
});
8287

8388
describe('#markdown', () => {
3.21 KB
Loading

0 commit comments

Comments
 (0)