Skip to content

Commit

Permalink
add test and assert on number of bundles instead
Browse files Browse the repository at this point in the history
  • Loading branch information
gorakong committed Jun 2, 2022
1 parent 36c647c commit de2085a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 56 deletions.
58 changes: 2 additions & 56 deletions packages/core/integration-tests/test/cache.js
Expand Up @@ -4451,29 +4451,7 @@ describe('cache', function () {
);
},
async update(b) {
assertBundles(b.bundleGraph, [
{
name: 'index.js',
type: 'js',
assets: [
'bundle-manifest.js',
'bundle-url.js',
'cacheLoader.js',
'index.js',
'js-loader.js',
],
},
{name: 'a.25c87b34.js', type: 'js', assets: ['a.js']},
{name: 'a.6aa86d57.js', type: 'js', assets: ['lodash.js']},
{name: 'b.9d35301a.js', type: 'js', assets: ['b.js']},
{
name: 'b.0c79a272.js',
type: 'js',
assets: ['index.js', 'index.js', 'react.development.js'],
},
{name: 'c.09dec791.js', type: 'js', assets: ['c.js']},
{name: 'd.004d4333.js', type: 'js', assets: ['d.js']},
]);
assert(b.bundleGraph.getBundles().length, 7);
let pkgFile = path.join(inputDir, 'package.json');
let pkg = JSON.parse(await overlayFS.readFile(pkgFile));
await overlayFS.writeFile(
Expand All @@ -4492,39 +4470,7 @@ describe('cache', function () {
},
'large-bundlegroup',
);
assertBundles(b.bundleGraph, [
{
name: 'index.js',
type: 'js',
assets: [
'bundle-manifest.js',
'bundle-url.js',
'cacheLoader.js',
'index.js',
'js-loader.js',
],
},
{
name: 'a.63720eaa.js',
type: 'js',
assets: ['a.js', 'lodash.js'],
},
{
name: 'b.8cde6b4e.js',
type: 'js',
assets: ['b.js', 'index.js', 'index.js', 'react.development.js'],
},
{
name: 'c.3cd1de9a.js',
type: 'js',
assets: ['c.js', 'lodash.js'],
},
{
name: 'd.1cd4208a.js',
type: 'js',
assets: ['d.js', 'index.js', 'index.js', 'react.development.js'],
},
]);
assert(b.bundleGraph.getBundles().length, 5);
});

it('should support updating bundler config', async function () {
Expand Down
@@ -0,0 +1 @@
module.exports = require('lodash').add(1, 1);
@@ -0,0 +1 @@
module.exports = require("react");
@@ -0,0 +1 @@
module.exports = require('lodash').add(2, 2);
@@ -0,0 +1 @@
module.exports = require("react");
@@ -0,0 +1,4 @@
import('./a.js');
import('./b.js');
import('./c.js');
import('./d.js');
@@ -0,0 +1 @@
{}
Empty file.

0 comments on commit de2085a

Please sign in to comment.