diff --git a/package.json b/package.json index b29f890919..fcfa64c244 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@types/jasminewd2": "^2.0.3", "@types/minimist": "^1.2.0", "@types/mock-fs": "^3.6.30", - "@types/node": "6.0.88", + "@types/node": "^10.9.4", "@types/selenium-webdriver": "3.0.7", "@types/shelljs": "^0.7.8", "@types/source-map": "^0.5.1", @@ -131,4 +131,4 @@ "xhr2": "0.1.4", "yargs": "9.0.1" } -} \ No newline at end of file +} diff --git a/packages/bazel/test/ng_package/common_package.spec.ts b/packages/bazel/test/ng_package/common_package.spec.ts index 81d8b32012..4d4e5fedac 100644 --- a/packages/bazel/test/ng_package/common_package.spec.ts +++ b/packages/bazel/test/ng_package/common_package.spec.ts @@ -10,7 +10,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as shx from 'shelljs'; -shx.cd(path.join(process.env['TEST_SRCDIR'], 'angular', 'packages', 'common', 'npm_package')); +shx.cd(path.join(process.env['TEST_SRCDIR'] !, 'angular', 'packages', 'common', 'npm_package')); describe('@angular/common ng_package', () => { describe('should have the locales files', () => { diff --git a/packages/bazel/test/ng_package/core_package.spec.ts b/packages/bazel/test/ng_package/core_package.spec.ts index 9ebb0001ff..8c92f66c29 100644 --- a/packages/bazel/test/ng_package/core_package.spec.ts +++ b/packages/bazel/test/ng_package/core_package.spec.ts @@ -10,7 +10,7 @@ import * as path from 'path'; import * as shx from 'shelljs'; const corePackagePath = - path.join(process.env['TEST_SRCDIR'], 'angular', 'packages', 'core', 'npm_package'); + path.join(process.env['TEST_SRCDIR'] !, 'angular', 'packages', 'core', 'npm_package'); shx.cd(corePackagePath); /** diff --git a/packages/bazel/test/ngc-wrapped/test_support.ts b/packages/bazel/test/ngc-wrapped/test_support.ts index 3e331f66d4..a9a674ee40 100644 --- a/packages/bazel/test/ngc-wrapped/test_support.ts +++ b/packages/bazel/test/ngc-wrapped/test_support.ts @@ -152,7 +152,7 @@ export function setup( function runOneBuildImpl(): boolean { return runOneBuild(['@' + tsConfigJsonPath]); } } -function makeTempDir(baseDir): string { +function makeTempDir(baseDir: string): string { const id = (Math.random() * 1000000).toFixed(0); const dir = path.join(baseDir, `tmp.${id}`); fs.mkdirSync(dir); diff --git a/packages/compiler-cli/src/transformers/program.ts b/packages/compiler-cli/src/transformers/program.ts index 8315f0e1a5..3cf68e000d 100644 --- a/packages/compiler-cli/src/transformers/program.ts +++ b/packages/compiler-cli/src/transformers/program.ts @@ -1021,7 +1021,7 @@ export function i18nExtract( const ext = i18nGetExtension(formatName); const content = i18nSerialize(bundle, formatName, options); const dstFile = outFile || `messages.${ext}`; - const dstPath = path.resolve(options.outDir || options.basePath, dstFile); + const dstPath = path.resolve(options.outDir || options.basePath !, dstFile); host.writeFile(dstPath, content, false, undefined, []); return [dstPath]; } diff --git a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts index 1d6045500e..05999b40d9 100644 --- a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts +++ b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts @@ -14,6 +14,9 @@ import {main, readCommandLineAndConfiguration, watchMode} from '../../src/main'; import {TestSupport, isInBazel, makeTempDir, setup} from '../test_support'; function setupFakeCore(support: TestSupport): void { + if (!process.env.TEST_SRCDIR) { + throw new Error('`setupFakeCore` must be run within a Bazel test'); + } const fakeCore = path.join( process.env.TEST_SRCDIR, 'angular/packages/compiler-cli/test/ngtsc/fake_core/npm_package'); diff --git a/packages/compiler-cli/test/test_support.ts b/packages/compiler-cli/test/test_support.ts index 1dcb259018..128c3f9750 100644 --- a/packages/compiler-cli/test/test_support.ts +++ b/packages/compiler-cli/test/test_support.ts @@ -110,6 +110,9 @@ function createTestSupportFor(basePath: string) { } export function setupBazelTo(basePath: string) { + if (!process.env.TEST_SRCDIR) { + throw new Error('`setupBazelTo()` must only be called from in a Bazel job.'); + } const sources = process.env.TEST_SRCDIR; const packages = path.join(sources, 'angular/packages'); const nodeModulesPath = path.join(basePath, 'node_modules'); diff --git a/yarn.lock b/yarn.lock index 3b9c87b183..28f365726d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -106,9 +106,9 @@ version "10.5.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707" -"@types/node@6.0.88": - version "6.0.88" - resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.88.tgz#f618f11a944f6a18d92b5c472028728a3e3d4b66" +"@types/node@^10.9.4": + version "10.9.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897" "@types/node@^6.0.46": version "6.0.114"