Skip to content

Commit

Permalink
test(client): add index bundle test
Browse files Browse the repository at this point in the history
  • Loading branch information
knagaitsev committed Jun 24, 2020
1 parent 33d81cf commit 26c9943
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/client/bundle.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

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

runBundleTest('bundled output', () => {
runBundleTest('index.bundle.js bundled output', () => {
it('should parse with ES5', () => {
const bundleStr = fs.readFileSync(
path.resolve(__dirname, '../../client/default/index.bundle.js'),
'utf8'
);
expect(() => {
acorn.parse(bundleStr, {
ecmaVersion: 5,
});
}).not.toThrow();
});
});

runBundleTest('main.js bundled output', () => {
let server;
let req;

Expand Down

0 comments on commit 26c9943

Please sign in to comment.