-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathpage-template.test.js
31 lines (19 loc) · 932 Bytes
/
page-template.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const fs = require('fs');
const path = require('path');
const expect = require('chai').expect;
const webpack = require('webpack');
const config = require('../examples/page-template/webpack.config');
describe('Page Template', function() {
it('Creates 2 pages with a shared wrapper, navigation, and footer', (done) => {
webpack(config, (error, result) => {
expect(error).to.equal(null);
const index_html = result.compilation.assets['index.html'].source();
const index_fixture = fs.readFileSync(path.resolve(__dirname, 'fixtures/page-template-index.html')).toString();
expect(index_html).to.equal(index_fixture);
const about_html = result.compilation.assets['about.html'].source();
const about_fixture = fs.readFileSync(path.resolve(__dirname, 'fixtures/page-template-about.html')).toString();
expect(about_html).to.equal(about_fixture);
done();
});
});
});