diff --git a/packages/compiler-cli/test/test_support.ts b/packages/compiler-cli/test/test_support.ts index b033097299..13a883eaf3 100644 --- a/packages/compiler-cli/test/test_support.ts +++ b/packages/compiler-cli/test/test_support.ts @@ -122,20 +122,21 @@ export function setupBazelTo(tmpDirPath: string) { fs.mkdirSync(nodeModulesPath); fs.mkdirSync(angularDirectory); - getAngularPackagesFromRunfiles().forEach( - ({pkgPath, name}) => { fs.symlinkSync(pkgPath, path.join(angularDirectory, name), 'dir'); }); + getAngularPackagesFromRunfiles().forEach(({pkgPath, name}) => { + fs.symlinkSync(pkgPath, path.join(angularDirectory, name), 'junction'); + }); // Link typescript const typeScriptSource = resolveNpmTreeArtifact('npm/node_modules/typescript'); const typescriptDest = path.join(nodeModulesPath, 'typescript'); - fs.symlinkSync(typeScriptSource, typescriptDest, 'dir'); + fs.symlinkSync(typeScriptSource, typescriptDest, 'junction'); // Link "rxjs" if it has been set up as a runfile. "rxjs" is linked optionally because // not all compiler-cli tests need "rxjs" set up. try { const rxjsSource = resolveNpmTreeArtifact('rxjs', 'index.js'); const rxjsDest = path.join(nodeModulesPath, 'rxjs'); - fs.symlinkSync(rxjsSource, rxjsDest, 'dir'); + fs.symlinkSync(rxjsSource, rxjsDest, 'junction'); } catch (e) { if (e.code !== 'MODULE_NOT_FOUND') throw e; } diff --git a/packages/language-service/test/reflector_host_spec.ts b/packages/language-service/test/reflector_host_spec.ts index 0f58ce06df..8e706dc3eb 100644 --- a/packages/language-service/test/reflector_host_spec.ts +++ b/packages/language-service/test/reflector_host_spec.ts @@ -7,12 +7,8 @@ */ import * as path from 'path'; -import * as ts from 'typescript'; -import {createLanguageService} from '../src/language_service'; import {ReflectorHost} from '../src/reflector_host'; -import {Completions, LanguageService} from '../src/types'; -import {TypeScriptServiceHost} from '../src/typescript_host'; import {toh} from './test_data'; import {MockTypescriptHost} from './test_utils'; @@ -25,12 +21,14 @@ describe('reflector_host_spec', () => { let mockHost = new MockTypescriptHost( ['/app/main.ts', '/app/parsing-cases.ts'], toh, 'app/node_modules', {...path, join: (...args: string[]) => originalJoin.apply(path, args)}); - let service = ts.createLanguageService(mockHost); - let ngHost = new TypeScriptServiceHost(mockHost, service); - let ngService = createLanguageService(ngHost); const reflectorHost = new ReflectorHost(() => undefined as any, mockHost, {basePath: '\\app'}); - spyOn(path, 'join').and.callFake((...args: string[]) => { return path.win32.join(...args); }); + if (process.platform !== 'win32') { + // If we call this in Windows it will cause a 'Maximum call stack size exceeded error' + // Because we are spying on the same function that we are call faking + spyOn(path, 'join').and.callFake((...args: string[]) => { return path.win32.join(...args); }); + } + const result = reflectorHost.moduleNameToFileName('@angular/core'); expect(result).not.toBeNull('could not find @angular/core using path.win32'); });