-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fixes and improvements from seng-boilerplate
Added fixes and improvements to unit testing from the seng-boilerplate repo: mediamonks/seng-boilerplate#28 mediamonks/seng-boilerplate#27 mediamonks/seng-boilerplate#23 Replaced some mediamonks/seng boilerplate names to knockout-validator equivalents.
- Loading branch information
Showing
12 changed files
with
226 additions
and
137 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
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,6 +1,6 @@ | ||
[![Travis](https://img.shields.io/travis/mediamonks/knockout-validator.svg?maxAge=2592000)](https://travis-ci.org/mediamonks/knockout-validator) | ||
[![Code Climate](https://img.shields.io/codeclimate/github/mediamonks/knockout-validator.svg?maxAge=2592000)](https://codeclimate.com/github/mediamonks/knockout-validator) | ||
[![Coveralls](https://img.shields.io/coveralls/mediamonks/knockout-validator.svg?maxAge=2592000)](https://coveralls.io/github/mediamonks/knockout-validator?branch=master) | ||
[![Travis](https://img.shields.io/travis/flut1/knockout-validator.svg?maxAge=2592000)](https://travis-ci.org/flut1/knockout-validator) | ||
[![Code Climate](https://img.shields.io/codeclimate/github/flut1/knockout-validator.svg?maxAge=2592000)](https://codeclimate.com/github/flut1/knockout-validator) | ||
[![Coveralls](https://img.shields.io/coveralls/flut1/knockout-validator.svg?maxAge=2592000)](https://coveralls.io/github/flut1/knockout-validator?branch=master) | ||
[![npm](https://img.shields.io/npm/v/knockout-validator.svg?maxAge=2592000)](https://www.npmjs.com/package/knockout-validator) | ||
[![npm](https://img.shields.io/npm/dm/knockout-validator.svg?maxAge=2592000)](https://www.npmjs.com/package/knockout-validator) | ||
|
||
|
@@ -24,7 +24,7 @@ the browser yourself, and grab one of the following files from the | |
`/dist/` folder: | ||
|
||
```sh | ||
git clone [email protected]:mediamonks/knockout-validator.git | ||
git clone [email protected]:flut1/knockout-validator.git | ||
cd knockout-validator | ||
npm i | ||
npm run build-dist | ||
|
@@ -49,7 +49,7 @@ import KnockoutValidator from 'knockout-validator'; | |
|
||
## Documentation | ||
|
||
View the [generated documentation](https://rawgit.com/mediamonks/knockout-validator/master/doc/typedoc/index.html). | ||
View the [generated documentation](https://rawgit.com/flut1/knockout-validator/master/doc/typedoc/index.html). | ||
|
||
|
||
## Building | ||
|
@@ -59,7 +59,7 @@ and [Node.js](http://nodejs.org/) installed. | |
|
||
Clone a copy of the repo: | ||
```sh | ||
git clone https://github.com/mediamonks/knockout-validator.git | ||
git clone https://github.com/flut1/knockout-validator.git | ||
``` | ||
|
||
Change to the knockout-validator directory: | ||
|
@@ -104,6 +104,6 @@ View [AUTHORS.md](./AUTHORS.md) | |
|
||
## LICENSE | ||
|
||
[MIT](./LICENSE) © MediaMonks | ||
[MIT](./LICENSE) © Floris Bernard | ||
|
||
|
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,95 +1,49 @@ | ||
var path = require('path'); | ||
var webpackConfig = require('./webpack.config')(); | ||
|
||
webpackConfig.module.postLoaders = [ | ||
// instrument only testing sources with Istanbul | ||
{ | ||
test: /\.ts$/, | ||
include: path.resolve('src/'), | ||
loader: 'istanbul-instrumenter' | ||
} | ||
]; | ||
|
||
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: ['mocha', 'chai'], | ||
|
||
// list of files / patterns to load in the browser | ||
frameworks: ['source-map-support', 'mocha', 'chai'], | ||
files: [ | ||
'test/index.js' | ||
'./test/index.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/index.js': ['webpack'], | ||
'src/*.ts': ['webpack','coverage'] // only for webstorm, real coverage is injected as webpack-loader | ||
}, | ||
|
||
webpack: { | ||
module : webpackConfig.module, | ||
resolve : webpackConfig.resolve | ||
'./src/**/*.ts': [ | ||
'webpack', | ||
'sourcemap', | ||
'coverage' | ||
], | ||
'./test/**/*.ts': [ | ||
'webpack' | ||
] | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress', 'coverage'], | ||
|
||
webpack: require('./webpack.config.test')(), | ||
webpackServer: { noInfo: true }, | ||
reporters: ['progress', 'coverage', 'karma-remap-istanbul'], | ||
coverageReporter: { | ||
dir: 'coverage', | ||
reporters: [ | ||
// reporters not supporting the `file` property | ||
{ type: 'json', dir: 'coverage', subdir: '.' }, | ||
{ type: 'lcov', dir: 'coverage', subdir: '.' }, | ||
|
||
{ type: 'json', subdir: '.' }, | ||
{ type: 'text' } | ||
] | ||
}, | ||
|
||
|
||
// web server port | ||
remapIstanbulReporter: { | ||
src: 'coverage/coverage-final.json', | ||
reports: { | ||
lcovonly: 'coverage/lcov.info', | ||
html: 'coverage/report' | ||
}, | ||
timeoutNotCreated: 5000, | ||
timeoutNoMoreFiles: 1000 | ||
}, | ||
logLevel: config.LOG_INFO, | ||
browsers: ['PhantomJS'], | ||
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: ['PhantomJS'], | ||
|
||
|
||
// 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 | ||
}) | ||
} | ||
}; |
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,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"target": "es5", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"preserveConstEnums": true, | ||
"noImplicitAny": false, | ||
"removeComments": false, | ||
"sourceMap": false, | ||
"inlineSourceMap": true | ||
}, | ||
"files": [ | ||
"typings/index.d.ts" | ||
] | ||
} |
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,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"target": "es5", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"preserveConstEnums": true, | ||
"noImplicitAny": false, | ||
"removeComments": false, | ||
"sourceMap": false, | ||
"inlineSourceMap": false, | ||
"outDir": "./" | ||
}, | ||
"files": [ | ||
"typings/index.d.ts" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*eslint-disable */ | ||
var path = require('path'); | ||
|
||
module.exports = function() | ||
{ | ||
return { | ||
devtool: 'inline-source-map', | ||
resolve: { | ||
extensions: ['', '.ts', '.js'] | ||
}, | ||
entry: './test/index.ts', | ||
verbose: true, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.ts$/, | ||
exclude: /node_modules/, | ||
loader: 'awesome-typescript-loader', | ||
query: { | ||
tsconfig: 'config/tsconfig.test.json' | ||
} | ||
} | ||
], | ||
postLoaders: [ | ||
{ | ||
test: /\.ts$/, | ||
loader: 'istanbul-instrumenter-loader', | ||
exclude: [ | ||
/node_modules/, | ||
/test/, | ||
/Spec\.ts$/ | ||
] | ||
} | ||
] | ||
} | ||
}; | ||
}; |
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,7 +1,7 @@ | ||
{ | ||
"name": "knockout-validator", | ||
"version": "1.0.0", | ||
"description": "Boilerplate and example project for all Seng projects", | ||
"description": "Painless form validation management using knockout.js", | ||
"main": "index.js", | ||
"typings": "index", | ||
"scripts": { | ||
|
@@ -14,15 +14,14 @@ | |
"check-coverage": "istanbul check-coverage --statement 1 --branches 1 --functions 1 --lines 1", | ||
"validate-webpack": "webpack-validator config/webpack.config.js", | ||
"lint": "tslint -c tslint.json src/**/*.ts", | ||
"clean": "rimraf dist lib index.js index.d.ts coverage", | ||
"clean": "rimraf dist lib index.js index.d.ts coverage \"knockout-validator.@(zip|tar.gz)\"", | ||
"compile": "npm-run-all typescript-npm typescript-system typescript-es6 webpack-dist", | ||
"typescript-npm": "tsc -p ./ -d", | ||
"typescript-system": "tsc -p ./ -m system --outFile ./dist/system/knockout-validator.js", | ||
"typescript-system": "tsc -p ./ -m system --outFile ./dist/knockout-validator-system.js", | ||
"typescript-es6": "tsc -p ./ -t es6 -m es6 --outDir ./dist/es6/", | ||
"webpack-dist": "node script/webpack.js", | ||
"doc": "npm-run-all -p typedoc yuidoc", | ||
"doc": "npm-run-all -p typedoc", | ||
"typedoc": "typedoc --out doc/typedoc/ src/", | ||
"yuidoc": "yuidoc -o doc/yuidoc/ -t ./node_modules/yuidoc-mediamonks-theme -H ./node_modules/yuidoc-mediamonks-theme/helpers/helpers.js src/", | ||
"generate": "npm-run-all clean compile test-unit doc", | ||
"build": "npm-run-all clean compile", | ||
"build-npm": "npm-run-all clean test typescript-npm", | ||
|
@@ -32,50 +31,50 @@ | |
"validate" | ||
], | ||
"author": "Floris Bernard <[email protected]> (flut1)", | ||
"homepage": "https://www.mediamonks.com/", | ||
"homepage": "https://github.com/flut1/knockout-validator/", | ||
"license": "MIT", | ||
"keywords": [ | ||
"seng", | ||
"mediamonks", | ||
"knockout", | ||
"validator", | ||
"forms", | ||
"formvalidation", | ||
"form validation", | ||
"typescript", | ||
"input" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/mediamonks/knockout-validator/issues" | ||
"url": "https://github.com/flut1/knockout-validator/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mediamonks/knockout-validator.git" | ||
"url": "https://github.com/flut1/knockout-validator.git" | ||
}, | ||
"devDependencies": { | ||
"awesome-typescript-loader": "^2.0.1", | ||
"chai": "^3.5.0", | ||
"chai-as-promised": "^5.3.0", | ||
"coveralls": "^2.11.6", | ||
"istanbul": "^0.4.3", | ||
"istanbul-instrumenter-loader": "^0.1.3", | ||
"istanbul-instrumenter-loader": "^0.2.0", | ||
"karma": "^0.13.19", | ||
"karma-chai": "^0.1.0", | ||
"karma-coverage": "^0.5.3", | ||
"karma-mocha": "^1.1.1", | ||
"karma-phantomjs-launcher": "^1.0.0", | ||
"karma-remap-istanbul": "^0.1.1", | ||
"karma-source-map-support": "^1.1.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^1.7.0", | ||
"marked": "^0.3.5", | ||
"mocha": "^2.5.3", | ||
"npm-run-all": "^2.2.0", | ||
"phantomjs-prebuilt": "^2.1.3", | ||
"pre-push": "^0.1.1", | ||
"rimraf": "^2.5.2", | ||
"ts-loader": "^0.8.0", | ||
"tslint": "^3.3.0", | ||
"typedoc": "^0.4.3", | ||
"typescript": "^1.8.0", | ||
"webpack": "^1.12.12", | ||
"webpack-validator": "^2.1.3", | ||
"yuidoc-mediamonks-theme": "^2.0.2", | ||
"yuidocjs": "^0.10.0" | ||
"webpack-validator": "^2.1.3" | ||
}, | ||
"dependencies": { | ||
"seng-disposable": "^1.0.1" | ||
|
Oops, something went wrong.