build(ngc): run integration test hermetically

This ensures we run in a clean directory, using our real distribution. It finds bugs like @internal
APIs needed to type-check in the offline compiler, as well as problems in package.json.

Also move tsc-wrapped under tools/@angular
This commit is contained in:
Alex Eagle
2016-05-27 16:22:16 -07:00
parent c6064a30a1
commit 3331321f64
35 changed files with 79 additions and 64 deletions

View File

@ -1,3 +1,11 @@
// Only needed to satisfy the check in core/src/util/decorators.ts
// TODO(alexeagle): maybe remove that check?
require('reflect-metadata');
require('@angular/platform-server/src/parse5_adapter.js').Parse5DomAdapter.makeCurrent();
require('zone.js/dist/zone-node.js');
require('zone.js/dist/long-stack-trace-zone.js');
import * as fs from 'fs';
import * as path from 'path';
import {BasicNgFactory} from '../src/basic.ngfactory';
@ -6,7 +14,7 @@ import {ReflectiveInjector, DebugElement, getDebugNode} from '@angular/core';
import {browserPlatform, BROWSER_APP_PROVIDERS} from '@angular/platform-browser';
describe("template codegen output", () => {
const outDir = path.join('dist', 'all', '@angular', 'compiler_cli', 'integrationtest', 'src');
const outDir = 'src';
it("should lower Decorators without reflect-metadata", () => {
const jsOutput = path.join(outDir, 'basic.js');
@ -62,4 +70,4 @@ describe("template codegen output", () => {
expect(debugElement.children[2].attributes['value']).toBe('1');
expect(debugElement.children[3].attributes['value']).toBe('2');
});
});
});