-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathcustom-multi-template-filename.js
30 lines (19 loc) · 1.01 KB
/
custom-multi-template-filename.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
const fs = require('fs');
const path = require('path');
const expect = require('chai').expect;
const webpack = require('webpack');
const config = require('../examples/custom-multi-template-filename/webpack.config');
describe('Custom Multi template_filename', function() {
it('Adds a static partial to the body of 2 different instances using array for "template_filename"', (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/custom-multi-template-filename-index.html')).toString();
expect(index_html).to.equal(index_fixture);
const other_html = result.compilation.assets['other-page.html'].source();
const other_fixture = fs.readFileSync(path.resolve(__dirname, 'fixtures/custom-multi-template-filename-other.html')).toString();
expect(other_html).to.equal(other_fixture);
done();
});
});
});