Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 44e4096

Browse files
committed
docs(testing): remove dis-used karma-htmlfile-reporter
also comments on the optional "testing" folder and corrects var names to match also leaves Jasmine Spec Runner output visible when tests finish
1 parent e57068c commit 44e4096

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

public/docs/_examples/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"karma": "^1.3.0",
6464
"karma-chrome-launcher": "^2.0.0",
6565
"karma-cli": "^1.0.1",
66-
"karma-htmlfile-reporter": "^0.3.4",
6766
"karma-jasmine": "^1.0.2",
6867
"karma-jasmine-html-reporter": "^0.2.2",
6968
"karma-phantomjs-launcher": "^1.0.2",

public/docs/_examples/testing/ts/app/banner.component.detect-changes.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { async } from '@angular/core/testing';
55
// #enddocregion import-async
66
// #docregion import-ComponentFixtureAutoDetect
7-
import { ComponentFixtureAutoDetect} from '@angular/core/testing';
7+
import { ComponentFixtureAutoDetect } from '@angular/core/testing';
88
// #enddocregion import-ComponentFixtureAutoDetect
99
import { ComponentFixture, TestBed } from '@angular/core/testing';
1010
import { By } from '@angular/platform-browser';

public/docs/_examples/testing/ts/karma-test-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var allSpecFiles = Object.keys(window.__karma__.files)
2929

3030
System.config({
3131
baseURL: 'base',
32-
// Extend usual application package list with test folder
32+
// Extend usual application package list with testing folder
3333
packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } },
3434

3535
// Assume npm: is set in `paths` in systemjs.config

public/docs/_examples/testing/ts/karma.conf.js

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
// #docregion
22
module.exports = function(config) {
33

4-
var appBase = 'app/'; // transpiled app JS and map files
5-
var appSrcBase = 'app/'; // app source TS files
4+
var appBase = 'app/'; // transpiled app JS and map files
5+
var appSrcBase = 'app/'; // app source TS files
66
var appAssets = 'base/app/'; // component assets fetched by Angular's compiler
77

8-
var testBase = 'testing/'; // transpiled test JS and map files
9-
var testSrcBase = 'testing/'; // test source TS files
8+
// Testing helpers (optional) are conventionally in a folder called `testing`
9+
var testingBase = 'testing/'; // transpiled test JS and map files
10+
var testingSrcBase = 'testing/'; // test source TS files
1011

1112
config.set({
1213
basePath: '',
1314
frameworks: ['jasmine'],
15+
1416
plugins: [
1517
require('karma-jasmine'),
1618
require('karma-chrome-launcher'),
17-
require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it
18-
require('karma-htmlfile-reporter') // crashing w/ strange socket error
19+
require('karma-jasmine-html-reporter') // click "Debug" in browser to see it
1920
],
2021

22+
client: {
23+
clearContext: false // leave Jasmine Spec Runner output visible in browser
24+
},
25+
2126
customLaunchers: {
2227
// From the CLI. Not used here but interesting
2328
// chrome setup for travis CI using chromium
@@ -26,6 +31,7 @@ module.exports = function(config) {
2631
flags: ['--no-sandbox']
2732
}
2833
},
34+
2935
files: [
3036
// System.js for module loading
3137
'node_modules/systemjs/dist/system.src.js',
@@ -58,7 +64,7 @@ module.exports = function(config) {
5864

5965
// transpiled application & spec code paths loaded via module imports
6066
{pattern: appBase + '**/*.js', included: false, watched: true},
61-
{pattern: testBase + '**/*.js', included: false, watched: true},
67+
{pattern: testingBase + '**/*.js', included: false, watched: true},
6268

6369

6470
// Asset (HTML & CSS) paths loaded via Angular's component compiler
@@ -69,8 +75,8 @@ module.exports = function(config) {
6975
// Paths for debugging with source maps in dev tools
7076
{pattern: appSrcBase + '**/*.ts', included: false, watched: false},
7177
{pattern: appBase + '**/*.js.map', included: false, watched: false},
72-
{pattern: testSrcBase + '**/*.ts', included: false, watched: false},
73-
{pattern: testBase + '**/*.js.map', included: false, watched: false}
78+
{pattern: testingSrcBase + '**/*.ts', included: false, watched: false},
79+
{pattern: testingBase + '**/*.js.map', included: false, watched: false}
7480
],
7581

7682
// Proxied base paths for loading assets
@@ -81,18 +87,7 @@ module.exports = function(config) {
8187

8288
exclude: [],
8389
preprocessors: {},
84-
// disabled HtmlReporter; suddenly crashing w/ strange socket error
85-
reporters: ['progress', 'kjhtml'],//'html'],
86-
87-
// HtmlReporter configuration
88-
htmlReporter: {
89-
// Open this file to see results in browser
90-
outputFile: '_test-output/tests.html',
91-
92-
// Optional
93-
pageTitle: 'Unit Tests',
94-
subPageTitle: __dirname
95-
},
90+
reporters: ['progress', 'kjhtml'],
9691

9792
port: 9876,
9893
colors: true,

0 commit comments

Comments
 (0)