1 |
|
2 |
|
3 | import assert from 'assert';
|
4 | import {Bundle, NamedBundle} from '../src/public/Bundle';
|
5 | import BundleGraph from '../src/BundleGraph';
|
6 | import {createEnvironment} from '../src/Environment';
|
7 | import {DEFAULT_OPTIONS} from './utils';
|
8 | import Graph from '../src/Graph';
|
9 |
|
10 | describe('Public Bundle', () => {
|
11 | let internalBundle;
|
12 | let bundleGraph;
|
13 | beforeEach(() => {
|
14 | let env = createEnvironment({});
|
15 | internalBundle = {
|
16 | id: '123',
|
17 | entryAssetIds: [],
|
18 | type: 'js',
|
19 | env,
|
20 | filePath: null,
|
21 | name: null,
|
22 | pipeline: null,
|
23 | isEntry: null,
|
24 | isInline: null,
|
25 | isSplittable: true,
|
26 | target: {
|
27 | env,
|
28 | distDir: '',
|
29 | name: '',
|
30 | publicUrl: '',
|
31 | },
|
32 | stats: {size: 0, time: 0},
|
33 | };
|
34 |
|
35 | bundleGraph = new BundleGraph({graph: new Graph()});
|
36 | });
|
37 |
|
38 | it('returns the same public Bundle given an internal bundle', () => {
|
39 | assert.equal(
|
40 | new Bundle(internalBundle, bundleGraph, DEFAULT_OPTIONS),
|
41 | new Bundle(internalBundle, bundleGraph, DEFAULT_OPTIONS),
|
42 | );
|
43 | });
|
44 |
|
45 | it('returns the same public NamedBundle given an internal bundle', () => {
|
46 | assert.equal(
|
47 | new NamedBundle(internalBundle, bundleGraph, DEFAULT_OPTIONS),
|
48 | new NamedBundle(internalBundle, bundleGraph, DEFAULT_OPTIONS),
|
49 | );
|
50 | });
|
51 | });
|