Skip to content

Commit 26c9943

Browse files
committed
test(client): add index bundle test
1 parent 33d81cf commit 26c9943

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/client/bundle.test.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
const fs = require('fs');
4+
const path = require('path');
35
const acorn = require('acorn');
46
const request = require('supertest');
57
const testServer = require('../helpers/test-server');
@@ -13,7 +15,21 @@ describe('bundle', () => {
1315
// only be avoided with babel-loader
1416
const runBundleTest = isWebpack5 ? describe.skip : describe;
1517

16-
runBundleTest('bundled output', () => {
18+
runBundleTest('index.bundle.js bundled output', () => {
19+
it('should parse with ES5', () => {
20+
const bundleStr = fs.readFileSync(
21+
path.resolve(__dirname, '../../client/default/index.bundle.js'),
22+
'utf8'
23+
);
24+
expect(() => {
25+
acorn.parse(bundleStr, {
26+
ecmaVersion: 5,
27+
});
28+
}).not.toThrow();
29+
});
30+
});
31+
32+
runBundleTest('main.js bundled output', () => {
1733
let server;
1834
let req;
1935

0 commit comments

Comments
 (0)