Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 800f515

Browse files
committed
test(rollup): fix rollup tests
fix rollup tests
1 parent 23ad195 commit 800f515

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/spec/ion-compiler.spec.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ describe('ion-compiler', () => {
3535
// arrange
3636
let context: BuildContext = {};
3737
context.fileCache = new FileCache();
38-
context.fileCache.put(importer, null);
3938

4039
// act
4140
const result = resolveId('importee', importer, context);
@@ -44,11 +43,30 @@ describe('ion-compiler', () => {
4443
expect(result).toEqual(null);
4544
});
4645

47-
it('should return null when importer content lacks output property', () => {
46+
it('should return null when importer content is null', () => {
4847
// arrange
4948
let context: BuildContext = {};
5049
context.fileCache = new FileCache();
51-
context.fileCache.put(importer, null);
50+
context.fileCache.put(importer, {
51+
path: importer,
52+
content: null
53+
});
54+
55+
// act
56+
const result = resolveId('importee', importer, context);
57+
58+
// assert
59+
expect(result).toEqual(null);
60+
});
61+
62+
it('should return null when importer content is empty', () => {
63+
// arrange
64+
let context: BuildContext = {};
65+
context.fileCache = new FileCache();
66+
context.fileCache.put(importer, {
67+
path: importer,
68+
content: ''
69+
});
5270

5371
// act
5472
const result = resolveId('importee', importer, context);

0 commit comments

Comments
 (0)