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

Commit c520bb2

Browse files
committed
fix: Add (broken) test
1 parent 5a10ad3 commit c520bb2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/test/project-manager.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ describe('ProjectManager', () => {
2424
assert.isDefined(configs.find(config => config.configFilePath === '/foo/tsconfig.json'));
2525
});
2626

27+
describe('ensureBasicFiles', () => {
28+
beforeEach(async () => {
29+
memfs = new InMemoryFileSystem('/');
30+
const localfs = new MapFileSystem(new Map([
31+
['file:///project/package.json', '{"name": "package-name-1"}'],
32+
['file:///project/tsconfig.json', '{ "compilerOptions": { "typeRoots": ["../types"]} }'],
33+
['file:///project/file.ts', 'console.log(GLOBALCONSTANT);'],
34+
['file:///types/types.d.ts', 'declare var GLOBALCONSTANT=1;']
35+
36+
]));
37+
const updater = new FileSystemUpdater(localfs, memfs);
38+
projectManager = new ProjectManager('/', memfs, updater, true);
39+
});
40+
it('loads files from typeRoots', async () => {
41+
await projectManager.ensureReferencedFiles('file:///project/file.ts').toPromise();
42+
projectManager.invalidateModuleStructure();
43+
await projectManager.ensureModuleStructure().toPromise();
44+
memfs.getContent('file:///project/file.ts');
45+
memfs.getContent('file:///types/types.d.ts');
46+
});
47+
});
48+
2749
describe('getPackageName()', () => {
2850
beforeEach(async () => {
2951
memfs = new InMemoryFileSystem('/');

0 commit comments

Comments
 (0)