Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Gałka committed Oct 16, 2017
1 parent c1245d1 commit bf76a82
Show file tree
Hide file tree
Showing 27 changed files with 2,105 additions and 226 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ Desktop.ini
# Build files
dist/*

# Coverage
coverage/*

# Playground tmp files
.playground
12 changes: 12 additions & 0 deletions init-test-bed.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use strict";
exports.__esModule = true;
require("reflect-metadata");
require("zone.js/dist/zone.js");
require("zone.js/dist/proxy.js");
require("zone.js/dist/sync-test.js");
require("zone.js/dist/jasmine-patch.js");
require("zone.js/dist/async-test.js");
require("zone.js/dist/fake-async-test.js");
var testing_1 = require("@angular/core/testing");
var testing_2 = require("@angular/platform-browser-dynamic/testing");
testing_1.TestBed.initTestEnvironment(testing_2.BrowserDynamicTestingModule, testing_2.platformBrowserDynamicTesting());
17 changes: 17 additions & 0 deletions init-test-bed.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'reflect-metadata'
import 'zone.js/dist/zone.js'
import 'zone.js/dist/proxy.js'
import 'zone.js/dist/sync-test.js'
import 'zone.js/dist/jasmine-patch.js'
import 'zone.js/dist/async-test.js'
import 'zone.js/dist/fake-async-test.js'
import { TestBed } from '@angular/core/testing'
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing'

TestBed.initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
)
82 changes: 82 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Karma configuration
// Generated on Wed Oct 11 2017 18:56:07 GMT+0200 (Central European Daylight Time)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'karma-typescript'],


// list of files / patterns to load in the browser
files: [
'init-test-bed.spec.ts',
'src/**/*.ts'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'**/*.ts': ['karma-typescript']
},

karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
transforms: [
require('karma-typescript-angular2-transform')
]
},
compilerOptions: {
lib: ['ES2015', 'DOM']
}
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'karma-typescript'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
Loading

0 comments on commit bf76a82

Please sign in to comment.