1️⃣ #32 setup unit test first dumb test

This commit is contained in:
Eugenio Romano 2016-04-19 17:06:47 +01:00
parent 84e5a6a45b
commit 5e65e55ecd
3 changed files with 31 additions and 8 deletions

View File

@ -1,7 +1,7 @@
<h1 align="center">Alfresco Angular 2 Components</h1> <h1 align="center">Alfresco Angular 2 Components</h1>
<p align="center"> <p align="center">
<img title="alfresco" alt='alfresco' src='../assets/alfresco.png' width="200px" height="150px" ></img> <img title="alfresco" alt='alfresco' src='../assets/alfresco.png' width="280px" height="150px" ></img>
<img title="angular2" alt='angular2' src='../assets/angular2.png' width="150px" height="150px" ></img> <img title="angular2" alt='angular2' src='../assets/angular2.png' width="150px" height="150px" ></img>
</p> </p>
<p align="center"> <p align="center">
@ -11,11 +11,11 @@
</p> </p>
### Prerequisites ## Prerequisites
- [Alfresco Docker image with CORS support](https://github.com/wabson/alfresco-docker-cors) - [Alfresco Docker image with CORS support](https://github.com/wabson/alfresco-docker-cors)
### Start development ## Start development
Install the npm packages described in the `package.json` and verify that it works: Install the npm packages described in the `package.json` and verify that it works:
@ -32,23 +32,27 @@ Remember the npm scripts in `package.json`:
* To runs the compiler and a server at the same time, both in "watch mode" * To runs the compiler and a server at the same time, both in "watch mode"
```$ npm start``` ```$ npm start```
* To runs the test
```$ npm test```
* To runs the TypeScript compiler once * To runs the TypeScript compiler once
```$ npm run tsc`` ```$ npm run tsc```
* To runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them * To runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them
```$ npm run tsc:w`` ```$ npm run tsc:w```
* To runs the [lite-server](https://www.npmjs.com/package/lite-server), a light-weight, static file server, written and maintained by [John Papa](https://github.com/johnpapa) and [Christopher Martin](https://github.com/cgmartin) with excellent support for Angular apps that use routing. * To runs the [lite-server](https://www.npmjs.com/package/lite-server), a light-weight, static file server, written and maintained by [John Papa](https://github.com/johnpapa) and [Christopher Martin](https://github.com/cgmartin) with excellent support for Angular apps that use routing.
```$ npm run lite`` ```$ npm run lite```
* To runs the typings tool * To runs the typings tool
```$ npm run typings`` ```$ npm run typings```
* called by *npm* automatically *after* it successfully completes package installation. This script installs the TypeScript definition files this app requires * called by *npm* automatically *after* it successfully completes package installation. This script installs the TypeScript definition files this app requires
```$ npm run postinstall`` ```$ npm run postinstall```

View File

@ -6,6 +6,7 @@
"build.prod": "gulp build", "build.prod": "gulp build",
"prestart": "npm install", "prestart": "npm install",
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ", "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"test": "live-server --open=test/tests-runner.html",
"tsc": "tsc", "tsc": "tsc",
"tsc:w": "tsc -w", "tsc:w": "tsc -w",
"lite": "lite-server", "lite": "lite-server",
@ -37,6 +38,7 @@
"gulp-typescript": "^2.8.0", "gulp-typescript": "^2.8.0",
"jasmine-core": "2.4.1", "jasmine-core": "2.4.1",
"lite-server": "^2.2.0", "lite-server": "^2.2.0",
"live-server":"^0.9.2",
"tsconfig-glob": "^0.3.3", "tsconfig-glob": "^0.3.3",
"typescript": "^1.8.10", "typescript": "^1.8.10",
"typings": "^0.7.12" "typings": "^0.7.12"

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Ng App Unit Tests</title>
<link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="../node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
</head>
<body>
<!-- Unit Testing Chapter #1: Proof of life. -->
<script>
it('true is true', function(){ expect(true).toEqual(true); });
</script>
</body>
</html>