1 |
|
2 |
|
3 | import assert from 'assert';
|
4 | import {Asset, MutableAsset} from '../src/public/Asset';
|
5 | import InternalAsset, {createAsset} from '../src/InternalAsset';
|
6 | import {createEnvironment} from '../src/Environment';
|
7 | import {DEFAULT_OPTIONS} from './utils';
|
8 |
|
9 | describe('Public Asset', () => {
|
10 | let internalAsset;
|
11 | beforeEach(() => {
|
12 | internalAsset = new InternalAsset({
|
13 | options: DEFAULT_OPTIONS,
|
14 | value: createAsset({
|
15 | filePath: '/does/not/exist',
|
16 | type: 'js',
|
17 | env: createEnvironment({}),
|
18 | isSource: true,
|
19 | stats: {size: 0, time: 0},
|
20 | }),
|
21 | });
|
22 | });
|
23 |
|
24 | it('returns the same public Asset given an internal asset', () => {
|
25 | assert.equal(new Asset(internalAsset), new Asset(internalAsset));
|
26 | });
|
27 |
|
28 | it('returns the same public MutableAsset given an internal asset', () => {
|
29 | assert.equal(
|
30 | new MutableAsset(internalAsset),
|
31 | new MutableAsset(internalAsset),
|
32 | );
|
33 | });
|
34 | });
|