diff --git a/angular-cli.json b/.angular-cli.json similarity index 72% rename from angular-cli.json rename to .angular-cli.json index 78d2b166..1b8004df 100644 --- a/angular-cli.json +++ b/.angular-cli.json @@ -1,6 +1,6 @@ { + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { - "version": "1.0.0-beta.30", "name": "meditation-plus-angular" }, "apps": [ @@ -17,7 +17,8 @@ "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", - "tsconfig": "tsconfig.json", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ "../node_modules/normalize.css/normalize.css", @@ -30,8 +31,8 @@ "../node_modules/moment-timezone/moment-timezone.js", "../node_modules/socket.io-client/dist/socket.io.min.js" ], + "environmentSource": "environments/environment.ts", "environments": { - "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } @@ -45,11 +46,15 @@ "lint": [ { "files": "src/**/*.ts", - "project": "src/tsconfig.json" + "project": "src/tsconfig.app.json" + }, + { + "files": "src/**/*.ts", + "project": "src/tsconfig.spec.json" }, { "files": "e2e/**/*.ts", - "project": "e2e/tsconfig.json" + "project": "e2e/tsconfig.e2e.json" } ], "test": { @@ -58,19 +63,10 @@ } }, "defaults": { - "styleExt": "css", - "prefixInterfaces": false, - "inline": { - "style": false, - "template": false - }, - "spec": { - "class": false, - "component": true, - "directive": true, - "module": false, - "pipe": true, - "service": true + "styleExt": "scss", + "component": { + "inlineTemplate": false, + "spec": true } } } diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts deleted file mode 100644 index 8dd65d75..00000000 --- a/e2e/app.e2e-spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MeditationPlusAngularPage } from './app.po'; - -describe('meditation-plus-angular App', function() { - let page: MeditationPlusAngularPage; - - beforeEach(() => { - page = new MeditationPlusAngularPage(); - }); - - it('should display message saying app works', () => { - page.navigateTo(); - expect(page.getParagraphText()).toEqual('app works!'); - }); -}); diff --git a/e2e/app.po.ts b/e2e/app.po.ts deleted file mode 100644 index 4cb3a642..00000000 --- a/e2e/app.po.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { browser, element, by } from 'protractor'; - -export class MeditationPlusAngularPage { - navigateTo() { - return browser.get('/'); - } - - getParagraphText() { - return element(by.css('app-root h1')).getText(); - } -} diff --git a/e2e/tsconfig.json b/e2e/tsconfig.e2e.json similarity index 67% rename from e2e/tsconfig.json rename to e2e/tsconfig.e2e.json index 656bdb14..72a2d6d9 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.e2e.json @@ -1,16 +1,19 @@ { - "compileOnSave": false, "compilerOptions": { + "sourceMap": true, "declaration": false, + "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, + "lib": [ + "es2016" + ], + "outDir": "../out-tsc/e2e", "module": "commonjs", - "moduleResolution": "node", - "outDir": "../dist/out-tsc-e2e", - "sourceMap": true, "target": "es5", - "typeRoots": [ - "../node_modules/@types" + "types":[ + "jasmine", + "node" ] } } diff --git a/karma.conf.js b/karma.conf.js index c8615f94..25866a08 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -8,9 +8,13 @@ module.exports = function (config) { plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), - require('karma-remap-istanbul'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), require('@angular/cli/plugins/karma') ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, files: [ { pattern: './src/test.ts', watched: false } ], @@ -20,19 +24,16 @@ module.exports = function (config) { mime: { 'text/x-typescript': ['ts','tsx'] }, - remapIstanbulReporter: { - reports: { - html: 'coverage', - lcovonly: './coverage/coverage.lcov' - } + coverageIstanbulReporter: { + reports: [ 'html', 'lcovonly' ], + fixWebpackSourcePaths: true }, angularCli: { - config: './angular-cli.json', environment: 'dev' }, reporters: config.angularCli && config.angularCli.codeCoverage - ? ['progress', 'karma-remap-istanbul'] - : ['progress'], + ? ['progress', 'coverage-istanbul'] + : ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/package.json b/package.json index 5c9c0206..9745def7 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,10 @@ "scripts": { "ng": "ng", "start": "ng serve", + "build": "ng build", "test": "ng test", - "pree2e": "webdriver-manager update --standalone false --gecko false", - "e2e": "protractor", + "lint": "ng lint", + "e2e": "ng e2e", "sw": "sw-precache --root=dist --config=sw-precache-config.js" }, "repository": { @@ -22,18 +23,19 @@ }, "private": true, "dependencies": { - "@angular/common": "^2.3.1", - "@angular/compiler": "^2.3.1", - "@angular/core": "^2.3.1", - "@angular/forms": "^2.3.1", - "@angular/http": "^2.3.1", - "@angular/material": "^2.0.0-beta.2", - "@angular/platform-browser": "^2.3.1", - "@angular/platform-browser-dynamic": "^2.3.1", - "@angular/router": "^3.3.1", + "@angular/animations": "^4.0.0", + "@angular/common": "^4.0.0", + "@angular/compiler": "^4.0.0", + "@angular/core": "^4.0.0", + "@angular/forms": "^4.0.0", + "@angular/http": "^4.0.0", + "@angular/material": "^2.0.0-b4.0.0", + "@angular/platform-browser": "^4.0.0", + "@angular/platform-browser-dynamic": "^4.0.0", + "@angular/router": "^4.0.0", "angular2-jwt": "^0.1.28", - "angular2-linky": "^1.2.2", - "angular2-moment": "^1.1.0", + "angular2-linky": "^1.2.3", + "angular2-moment": "^1.3.3", "chart.js": "^2.3.0", "chroma-js": "^1.2.2", "core-js": "^2.4.1", @@ -43,17 +45,16 @@ "moment-timezone": "^0.5.11", "ng2-charts": "^1.5.0", "normalize.css": "^5.0.0", - "rxjs": "^5.0.1", + "rxjs": "^5.1.0", "scriptjs": "^2.5.8", - "socket.io-client": "^1.7.2", + "socket.io-client": "^1.7.3", "stable-interval": "^0.0.4", - "timezones.json": "^1.1.0", - "ts-helpers": "^1.1.1", - "zone.js": "^0.7.2" + "timezones.json": "^1.2.0", + "zone.js": "^0.8.4" }, "devDependencies": { - "@angular/cli": "1.0.0-beta.30", - "@angular/compiler-cli": "^2.3.1", + "@angular/cli": "^1.0.0", + "@angular/compiler-cli": "^4.0.0", "@types/chart.js": "^0.0.12", "@types/chroma-js": "^1.1.32", "@types/emojione": "^2.2.0", @@ -61,21 +62,22 @@ "@types/jstimezonedetect": "^1.0.0", "@types/moment": "^2.13.0", "@types/moment-timezone": "^0.2.34", - "@types/node": "^7.0.5", + "@types/node": "~6.0.60", "@types/scriptjs": "^0.0.2", "@types/socket.io-client": "^1.4.29", - "codelyzer": "~2.0.0-beta.1", - "jasmine-core": "2.5.2", - "jasmine-spec-reporter": "2.5.0", - "karma": "1.2.0", + "codelyzer": "~2.0.0", + "jasmine-core": "~2.5.2", + "jasmine-spec-reporter": "~3.2.0", + "karma": "~1.4.1", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", - "karma-jasmine": "^1.0.2", - "karma-remap-istanbul": "^0.2.1", - "protractor": "~4.0.13", - "sw-precache": "^4.3.0", - "ts-node": "1.2.1", - "tslint": "^4.3.0", - "typescript": "~2.0.3" + "karma-coverage-istanbul-reporter": "^0.2.0", + "karma-jasmine": "^1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.1.0", + "sw-precache": "^5.1.0", + "ts-node": "~2.0.0", + "tslint": "^4.5.0", + "typescript": "~2.1.0" } } diff --git a/protractor.conf.js b/protractor.conf.js index ffded701..5edf25f1 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -2,7 +2,7 @@ // https://github.com/angular/protractor/blob/master/lib/config.ts /*global jasmine */ -var SpecReporter = require('jasmine-spec-reporter'); +const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { allScriptsTimeout: 11000, @@ -20,13 +20,12 @@ exports.config = { defaultTimeoutInterval: 30000, print: function() {} }, - useAllAngular2AppRoots: true, beforeLaunch: function() { require('ts-node').register({ project: 'e2e' }); }, onPrepare: function() { - jasmine.getEnv().addReporter(new SpecReporter()); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); } }; diff --git a/src/app/admin/appointment/appointment-form.component.ts b/src/app/admin/appointment/appointment-form.component.ts index 76d29cd9..81d028ea 100644 --- a/src/app/admin/appointment/appointment-form.component.ts +++ b/src/app/admin/appointment/appointment-form.component.ts @@ -8,7 +8,7 @@ import { AppointmentService } from '../../appointment'; }) export class AppointmentFormComponent { - appointment: Object; + appointment; loading = false; constructor( diff --git a/src/app/admin/broadcast/broadcast-form.component.ts b/src/app/admin/broadcast/broadcast-form.component.ts index 64c670a4..0db97cfd 100644 --- a/src/app/admin/broadcast/broadcast-form.component.ts +++ b/src/app/admin/broadcast/broadcast-form.component.ts @@ -8,7 +8,7 @@ import { BroadcastService } from './broadcast.service'; }) export class BroadcastFormComponent { - broadcast: Object; + broadcast; loading: boolean; constructor( diff --git a/src/app/admin/commitment/commitment-form.component.ts b/src/app/admin/commitment/commitment-form.component.ts index 47f5770b..bd9ebc23 100644 --- a/src/app/admin/commitment/commitment-form.component.ts +++ b/src/app/admin/commitment/commitment-form.component.ts @@ -11,7 +11,7 @@ import { CommitmentService } from '../../commitment'; }) export class CommitmentFormComponent { - commitment: Object; + commitment; loading = false; constructor( diff --git a/src/app/app.e2e.ts b/src/app/app.e2e.ts deleted file mode 100755 index 65af8347..00000000 --- a/src/app/app.e2e.ts +++ /dev/null @@ -1,32 +0,0 @@ -describe('App', () => { - - beforeEach(() => { - browser.get('/'); - }); - - - it('should have a title', () => { - const subject = browser.getTitle(); - const result = 'Angular2 Webpack Starter by @gdi2290 from @AngularClass'; - expect(subject).toEqual(result); - }); - - it('should have
', () => { - const subject = element(by.css('app header')).isPresent(); - const result = true; - expect(subject).toEqual(result); - }); - - it('should have
', () => { - const subject = element(by.css('app main')).isPresent(); - const result = true; - expect(subject).toEqual(result); - }); - - it('should have