Skip to content

Commit

Permalink
docs: add example projects
Browse files Browse the repository at this point in the history
  • Loading branch information
yisraelx committed Apr 3, 2017
1 parent cb62426 commit fcdb5c7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 87 deletions.
65 changes: 2 additions & 63 deletions examples/auto/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,19 @@
// Karma configuration
// Generated on Sat Apr 01 2017 23:17:19 GMT+0300 (שעון קיץ ירושלים)

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: [],


// list of files / patterns to load in the browser
files: [
'test/**/*.spec.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: {
'test/**/*.spec.ts': ['tslint']
},

// karma-tslint config
// https://github.com/yisraelx/karma-tslint
tslintPreprocessor: {
formatter: 'prose',
configuration: {
rules: {
'no-var-keyword': true,
'no-any': true
}
}
formatter: 'prose'
},

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


// 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_DEBUG,


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


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


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

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
logLevel: config.LOG_DEBUG
})
};
8 changes: 4 additions & 4 deletions examples/auto/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "karma-tslint-example",
"name": "karma-tslint-auto-example",
"version": "0.0.1",
"scripts": {
"test": "karma start"
},
"devDependencies": {
"karma": "^1.5.0",
"karma-tslint": "file:///D:\\applications\\karma-tslint",
"tslint": "^5.0.0"
"karma": "*",
"karma-tslint": "../../",
"tslint": "*"
}
}
6 changes: 6 additions & 0 deletions examples/auto/test/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"no-var-keyword": true,
"no-any": true
}
}
6 changes: 4 additions & 2 deletions examples/default/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ module.exports = function (config) {
},

tslintPreprocessor: {
formatter: 'prose'
}
formatter: 'verbose',
configuration: 'default'
},

logLevel: config.LOG_DEBUG,
})
};
6 changes: 3 additions & 3 deletions examples/default/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "karma-tslint-auto-example",
"name": "karma-tslint-default-example",
"version": "0.0.1",
"scripts": {
"test": "karma start"
},
"devDependencies": {
"karma": "^1.5.0",
"karma": "*",
"karma-tslint": "../../",
"tslint": "^5.0.0"
"tslint": "*"
}
}
9 changes: 7 additions & 2 deletions examples/object/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ module.exports = function (config) {
},

tslintPreprocessor: {
formatter: 'verbose',
configuration: 'default'
formatter: 'vso',
configuration: {
rules: {
'no-var-keyword': true,
'no-any': true
}
}
},

logLevel: config.LOG_DEBUG,
Expand Down
6 changes: 3 additions & 3 deletions examples/object/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "karma-tslint-default-example",
"name": "karma-tslint-object-example",
"version": "0.0.1",
"scripts": {
"test": "karma start"
},
"devDependencies": {
"karma": "^1.5.0",
"karma": "*",
"karma-tslint": "../../",
"tslint": "^5.0.0"
"tslint": "*"
}
}
9 changes: 2 additions & 7 deletions examples/path/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ module.exports = function (config) {
},

tslintPreprocessor: {
formatter: 'vso',
configuration: {
rules: {
'no-var-keyword': true,
'no-any': true
}
}
formatter: 'pmd',
configuration: './config/tslint-config.json'
},

logLevel: config.LOG_DEBUG,
Expand Down
6 changes: 3 additions & 3 deletions examples/path/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "karma-tslint-object-example",
"name": "karma-tslint-path-example",
"version": "0.0.1",
"scripts": {
"test": "karma start"
},
"devDependencies": {
"karma": "^1.5.0",
"karma": "*",
"karma-tslint": "../../",
"tslint": "^5.0.0"
"tslint": "*"
}
}

0 comments on commit fcdb5c7

Please sign in to comment.