Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
feat(vcl): Tests for synthetize method
Browse files Browse the repository at this point in the history
  • Loading branch information
kptdobe committed May 15, 2019
1 parent 8ffdc74 commit 71bcd2d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/include-util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const fs = require('fs-extra');
const assert = require('assert');
const path = require('path');
const include = require('../src/fastly/include-util');
const { include, synthetize } = require('../src/fastly/include-util');

describe('Testing include-util.js', () => {
['simple'].forEach((f) => {
Expand All @@ -22,5 +22,15 @@ describe('Testing include-util.js', () => {
const expect = fs.readFileSync(path.resolve(__dirname, `fixtures/include-${f}-resolved.vcl`)).toString();
assert.equal(res, expect);
});

it('#synthetize', () => {
const res = synthetize('some content', '');
assert.equal(res, 'some content');
});

it('#synthetize', () => {
const res = synthetize('some content with an include\nsynthetic {"include:include.html"};\n', path.resolve(__dirname, 'fixtures'));
assert.equal(res, 'some content with an include\nsynthetic {"<html lang="en_US">\n Haha!\n</html>"};\n');
});
});
});

0 comments on commit 71bcd2d

Please sign in to comment.