test(ivy): add an integration test for ngcc (#25406)

This commit adds an integration test for ngcc, which runs ngcc
against most @angular packages. It does not yet make any assertions
on the result.

PR Close #25406
This commit is contained in:
Alex Rickabaugh 2018-08-09 14:23:56 +01:00 committed by Matias Niemelä
parent d33e0091df
commit c8baace554
4 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,31 @@
{
"name": "angular-integration",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@angular/animations": "file:../../dist/packages-dist/animations",
"@angular/common": "file:../../dist/packages-dist/common",
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@angular/core": "file:../../dist/packages-dist/core",
"@angular/forms": "file:../../dist/packages-dist/forms",
"@angular/http": "file:../../dist/packages-dist/http",
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
"@angular/router": "file:../../dist/packages-dist/router",
"@types/node": "^9.4.0",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
"concurrently": "3.4.0",
"lite-server": "2.2.2",
"protractor": "file:../../node_modules/protractor"
},
"scripts": {
"test": "./test.sh"
}
}

View File

@ -0,0 +1,20 @@
import {Component, NgModule, ɵrenderComponent as renderComponent} from '@angular/core';
import {CommonModule} from '@angular/common';
@Component({
selector: 'hello-world',
template: `
<button (click)="visible = true">See Message</button>
<h2 *ngIf="visible">Hello World</h2>
`,
})
class HelloWorld {
visible = false;
}
@NgModule({
declarations: [HelloWorld],
imports: [CommonModule],
})
class Module {}
renderComponent(HelloWorld);

10
integration/ngcc/test.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -x
PATH=$PATH:$(npm bin)
ivy-ngcc node_modules/@angular/common esm2015
cp -r node_modules_ngtsc/* node_modules/
ngc -p tsconfig-app.json

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"lib": ["es2015", "dom"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"outDir": "dist",
"types": ["node"],
"rootDir": "."
},
"files": [
"src/main.ts"
],
"angularCompilerOptions": {
"enableIvy": "ngtsc"
}
}