Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Commit f88fb45

Browse files
committed
test: add integration ng8
1 parent 7c6f076 commit f88fb45

18 files changed

+778
-176
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
# compiled output
44
/dist
5+
**/dist/**
56
/tmp
67
/out-tsc
78

89
# dependencies
910
/node_modules
11+
**/node_modules/**
1012

1113
# IDEs and editors
1214
/.idea

integration/hello-world-ng8/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Integration test
2+
3+
Integration test with Angular CLI 8, Angular 8, TypeScript 3.4
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"projects": {
5+
"ng8": {
6+
"root": ".",
7+
"sourceRoot": ".",
8+
"projectType": "application",
9+
"architect": {
10+
"build": {
11+
"builder": "@angular-devkit/build-angular:browser",
12+
"options": {
13+
"outputPath": "dist",
14+
"index": "src/index.html",
15+
"main": "src/main.ts",
16+
"tsConfig": "src/tsconfig.app.json",
17+
"polyfills": "src/polyfills.ts"
18+
},
19+
"configurations": {
20+
"production": {
21+
"optimization": true,
22+
"outputHashing": "all",
23+
"sourceMap": false,
24+
"extractCss": true,
25+
"namedChunks": false,
26+
"aot": true,
27+
"extractLicenses": true,
28+
"vendorChunk": false,
29+
"buildOptimizer": true,
30+
"fileReplacements": [
31+
{
32+
"replace": "src/environments/environment.ts",
33+
"with": "src/environments/environment.prod.ts"
34+
}
35+
]
36+
}
37+
}
38+
},
39+
"serve": {
40+
"builder": "@angular-devkit/build-angular:dev-server",
41+
"options": {
42+
"browserTarget": "ng8:build"
43+
},
44+
"configurations": {
45+
"production": {
46+
"browserTarget": "ng8:build:production"
47+
}
48+
}
49+
}
50+
}
51+
}
52+
},
53+
"cli": {
54+
"warnings": {
55+
"typescriptMismatch": false
56+
}
57+
}
58+
}
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "hello-world-ng8",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve",
8+
"test": "ng build --prod",
9+
"pretest": "yarn --frozen-lockfile --non-interactive --no-progress",
10+
"postinstall": "cpx -v -C \"../../dist/ngxs-data/**/*\" \"node_modules/@ngxs-labs/data/\""
11+
},
12+
"private": true,
13+
"devDependencies": {
14+
"@angular/animations": "8.0.0",
15+
"@angular/common": "8.0.0",
16+
"@angular/compiler": "8.0.0",
17+
"@angular/core": "8.0.0",
18+
"@angular/forms": "8.0.0",
19+
"@angular/platform-browser": "8.0.0",
20+
"@angular/platform-browser-dynamic": "8.0.0",
21+
"@angular/compiler-cli": "8.0.0",
22+
"@angular-devkit/build-ng-packagr": "0.800.6",
23+
"@angular-devkit/build-angular": "0.800.6",
24+
"@angular/router": "8.0.0",
25+
"@angular/cli": "8.0.0",
26+
"@types/node": "10.3.6",
27+
"rxjs": "6.2.1",
28+
"zone.js": "0.9.0",
29+
"typescript": "3.7.3",
30+
"core-js": "3.4.0",
31+
"@ngxs/store": "file:../../node_modules/@ngxs/store",
32+
"@ngxs/logger-plugin": "file:../../node_modules/@ngxs/logger-plugin",
33+
"cpx": "file:../../node_modules/cpx"
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--The content below is only a placeholder and can be replaced.-->
2+
<div style="text-align: center;">
3+
<h1>Welcome to {{ title }}::{{ app.snapshot }}!</h1>
4+
<img
5+
width="300"
6+
alt="Angular Logo"
7+
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
8+
/>
9+
</div>
10+
<h2>Here are some links to help you start:</h2>
11+
<ul>
12+
<li>
13+
<h2>
14+
<a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a>
15+
</h2>
16+
</li>
17+
<li>
18+
<h2>
19+
<a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">
20+
CLI Documentation
21+
</a>
22+
</h2>
23+
</li>
24+
<li>
25+
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
26+
</li>
27+
</ul>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component } from '@angular/core';
2+
import { AppState } from './app.state';
3+
4+
@Component({
5+
selector: 'app-root',
6+
templateUrl: './app.component.html'
7+
})
8+
export class AppComponent {
9+
title = 'app';
10+
11+
constructor(public readonly app: AppState) {}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
import { RouterModule, Routes } from '@angular/router';
4+
5+
import { StoreModule } from './store.module';
6+
import { AppComponent } from './app.component';
7+
8+
const routes: Routes = [{ path: '', component: AppComponent }];
9+
10+
@NgModule({
11+
declarations: [AppComponent],
12+
imports: [BrowserModule, RouterModule.forRoot(routes), StoreModule],
13+
bootstrap: [AppComponent]
14+
})
15+
export class AppModule {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { State } from '@ngxs/store';
2+
import { StateRepository, Persistence } from '@ngxs-labs/data/decorators';
3+
import { NgxsDataRepository } from '@ngxs-labs/data/repositories';
4+
5+
@Persistence()
6+
@StateRepository()
7+
@State<string>({
8+
name: 'app',
9+
defaults: 'hello world'
10+
})
11+
export class AppState extends NgxsDataRepository<string> {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { NgModule } from '@angular/core';
2+
import { NgxsModule } from '@ngxs/store';
3+
import { NgxsLoggerPluginModule } from '@ngxs/logger-plugin';
4+
import { NgxsDataPluginModule } from '@ngxs-labs/data';
5+
6+
import { AppState } from './app.state';
7+
8+
@NgModule({
9+
imports: [
10+
NgxsModule.forRoot([AppState]),
11+
NgxsLoggerPluginModule.forRoot(),
12+
NgxsDataPluginModule.forRoot()
13+
],
14+
exports: [NgxsModule]
15+
})
16+
export class StoreModule {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const environment = {
2+
production: true,
3+
hmr: false
4+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const environment = {
2+
production: false,
3+
hmr: true
4+
};
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>HelloWorldNg8Ts3.4</title>
6+
<base href="/" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { enableProdMode } from '@angular/core';
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
4+
import { AppModule } from './app/app.module';
5+
import { environment } from './environments/environment';
6+
7+
if (environment.production) {
8+
enableProdMode();
9+
}
10+
11+
const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);
12+
13+
bootstrap().catch((error) => console.error(error));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'zone.js/dist/zone';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"baseUrl": "./",
5+
"module": "esnext"
6+
},
7+
"exclude": ["**/*.spec.ts"]
8+
}
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compileOnSave": false,
3+
"angularCompilerOptions": {
4+
"strictTemplates": true,
5+
"fullTemplateTypeCheck": true,
6+
"annotateForClosureCompiler": true,
7+
"strictInjectionParameters": true,
8+
"skipTemplateCodegen": false,
9+
"preserveWhitespaces": true,
10+
"skipMetadataEmit": false,
11+
"disableTypeScriptVersionCheck": true
12+
},
13+
"compilerOptions": {
14+
"outDir": "./dist/out-tsc",
15+
"baseUrl": "./",
16+
"sourceMap": true,
17+
"declaration": false,
18+
"moduleResolution": "node",
19+
"emitDecoratorMetadata": true,
20+
"experimentalDecorators": true,
21+
"target": "es5",
22+
"paths": {},
23+
"skipLibCheck": true,
24+
"typeRoots": ["node_modules/@types"],
25+
"lib": ["es2017", "dom"]
26+
},
27+
"exclude": ["node_modules"]
28+
}

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"start": "ng serve --open --port 4400",
1414
"test": "jest --config ./jest.config.js",
1515
"test:ci": "jest --config ./jest.config.js --coverage",
16-
"test:types": "dtslint ./integration/types --localTs node_modules/typescript/lib"
16+
"test:types": "dtslint ./integration/types --localTs node_modules/typescript/lib",
17+
"// - INTEGRATION": "Integration builds",
18+
"integration:ng8": "cd integration/hello-world-ng8 && yarn test"
1719
},
1820
"prettier": "@angular-ru/prettier-config",
1921
"devDependencies": {
@@ -41,6 +43,7 @@
4143
"angular-cli-ghpages": "0.6.2",
4244
"core-js": "3.6.5",
4345
"coveralls": "3.1.0",
46+
"cpx": "^1.5.0",
4447
"dtslint": "3.5.1",
4548
"eslint": "6.8.0",
4649
"hammerjs": "2.0.8",

0 commit comments

Comments
 (0)