-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
202 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"project": { | ||
"version": "1.0.0-beta.16", | ||
"name": "signaturepad-demo" | ||
}, | ||
"apps": [ | ||
{ | ||
"root": "src", | ||
"outDir": "dist", | ||
"assets": "assets", | ||
"index": "index.html", | ||
"main": "main.ts", | ||
"test": "test.ts", | ||
"tsconfig": "../tsconfig.json", | ||
"prefix": "app", | ||
"mobile": false, | ||
"styles": [ | ||
"styles.css" | ||
], | ||
"scripts": [], | ||
"environments": { | ||
"source": "environments/environment.ts", | ||
"dev": "environments/environment.ts", | ||
"prod": "environments/environment.prod.ts" | ||
} | ||
} | ||
], | ||
"addons": [], | ||
"packages": [], | ||
"e2e": { | ||
"protractor": { | ||
"config": "./protractor.conf.js" | ||
} | ||
}, | ||
"test": { | ||
"karma": { | ||
"config": "./karma.conf.js" | ||
} | ||
}, | ||
"defaults": { | ||
"styleExt": "css", | ||
"prefixInterfaces": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/0.13/config/configuration-file.html | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', 'angular-cli'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-remap-istanbul'), | ||
require('karma-mocha-reporter'), | ||
require('angular-cli/plugins/karma') | ||
], | ||
files: [ | ||
{ pattern: './src/test.ts', watched: false } | ||
], | ||
preprocessors: { | ||
'./src/test.ts': ['angular-cli'] | ||
}, | ||
remapIstanbulReporter: { | ||
reports: { | ||
html: 'coverage', | ||
lcovonly: './coverage/coverage.lcov' | ||
} | ||
}, | ||
angularCli: { | ||
config: './angular-cli.json', | ||
environment: 'dev' | ||
}, | ||
reporters: [ | ||
'mocha', 'progress', 'karma-remap-istanbul' | ||
], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: false | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
import { beforeEach, beforeEachProviders, describe, expect, it } from '@angular/core/testing'; | ||
import { asyncCallbackFactory, injectAsyncWrapper, providers } from '../../../test/diExports'; | ||
import { Page2 } from './page2'; | ||
import { ComponentFixture, TestBed, async } from '@angular/core/testing'; | ||
import { App, MenuController, NavController, Platform, Config, Keyboard, Form, IonicModule } from 'ionic-angular'; | ||
import { ConfigMock, FormMock, NavMock, PlatformMock } from '../../../test/mocks'; | ||
import { Page2 } from './page2'; | ||
|
||
this.fixture = null; | ||
this.instance = null; | ||
|
||
describe('Page2', () => { | ||
|
||
beforeEachProviders(() => providers); | ||
beforeEach(injectAsyncWrapper(asyncCallbackFactory(Page2, this, true))); | ||
|
||
it('initialises', () => { | ||
expect(this.instance).not.toBeNull(); | ||
expect(this.fixture).not.toBeNull(); | ||
describe('Pages: Page2', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
Page2, | ||
], | ||
providers: [ | ||
{provide: App, useClass: ConfigMock}, | ||
{provide: Config, useClass: ConfigMock}, | ||
{provide: Form, useClass: FormMock}, | ||
{provide: Keyboard, useClass: ConfigMock}, | ||
{provide: MenuController, useClass: ConfigMock}, | ||
{provide: NavController, useValue: NavMock}, | ||
{provide: Platform, useValue: PlatformMock}, | ||
], | ||
imports: [ IonicModule ], | ||
}); | ||
}); | ||
|
||
it('should create page2', async(() => { | ||
let fixture: ComponentFixture<Page2> = TestBed.createComponent(Page2); | ||
let instance: any = fixture.debugElement.componentInstance; | ||
expect(instance).toBeTruthy(); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// This file includes polyfills needed by Angular 2 and is loaded before | ||
// the app. You can add your own extra polyfills to this file. | ||
import 'core-js/es6/symbol'; | ||
import 'core-js/es6/object'; | ||
import 'core-js/es6/function'; | ||
import 'core-js/es6/parse-int'; | ||
import 'core-js/es6/parse-float'; | ||
import 'core-js/es6/number'; | ||
import 'core-js/es6/math'; | ||
import 'core-js/es6/string'; | ||
import 'core-js/es6/date'; | ||
import 'core-js/es6/array'; | ||
import 'core-js/es6/regexp'; | ||
import 'core-js/es6/map'; | ||
import 'core-js/es6/set'; | ||
import 'core-js/es6/reflect'; | ||
|
||
import 'core-js/es7/reflect'; | ||
import 'zone.js/dist/zone'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import './polyfills.ts'; | ||
|
||
import 'zone.js/dist/long-stack-trace-zone'; | ||
import 'zone.js/dist/proxy.js'; | ||
import 'zone.js/dist/sync-test'; | ||
import 'zone.js/dist/jasmine-patch'; | ||
import 'zone.js/dist/async-test'; | ||
import 'zone.js/dist/fake-async-test'; | ||
|
||
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. | ||
declare var __karma__: any; | ||
declare var require: any; | ||
|
||
// Prevent Karma from running prematurely. | ||
__karma__.loaded = function (): any { /* no op */}; | ||
|
||
Promise.all([ | ||
System.import('@angular/core/testing'), | ||
System.import('@angular/platform-browser-dynamic/testing'), | ||
]) | ||
// First, initialize the Angular testing environment. | ||
.then(([testing, testingBrowser]) => { | ||
testing.getTestBed().initTestEnvironment( | ||
testingBrowser.BrowserDynamicTestingModule, | ||
testingBrowser.platformBrowserDynamicTesting() | ||
); | ||
}) | ||
// Then we find all the tests. | ||
.then(() => require.context('./', true, /\page2.spec\.ts/)) | ||
// And load the modules. | ||
.then(context => context.keys().map(context)) | ||
// Finally, start Karma to run the tests. | ||
.then(__karma__.start, __karma__.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Typings reference file, see links for more information | ||
// https://github.com/typings/typings | ||
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html | ||
|
||
declare var System: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"declaration": true, | ||
"declaration": false, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"lib": [ | ||
"dom", | ||
"es2015" | ||
"exlucde": [ | ||
"node_modules" | ||
], | ||
"module": "es2015", | ||
"lib": ["es6", "dom"], | ||
"mapRoot": "./", | ||
"module": "es6", | ||
"moduleResolution": "node", | ||
"target": "es5" | ||
}, | ||
"exclude": [ | ||
"node_modules" | ||
], | ||
"compileOnSave": false, | ||
"atom": { | ||
"rewriteTsconfig": false | ||
"outDir": "../dist/out-tsc", | ||
"sourceMap": true, | ||
"target": "es5", | ||
"typeRoots": [ | ||
"node_modules/@types" | ||
] | ||
} | ||
} |