
committed by
Ben Lesh

parent
f76a9ad156
commit
976389836e
@ -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', () => {
|
||||
|
@ -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);
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
@ -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];
|
||||
}
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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');
|
||||
|
Reference in New Issue
Block a user