Update coverage stuff
This commit is contained in:
parent
fd95abaf3c
commit
4c849b6560
|
@ -10,6 +10,13 @@ Here are some badges for open source projects.
|
||||||
Travis
|
Travis
|
||||||
[](https://travis-ci.org/rstacruz/REPO)
|
[](https://travis-ci.org/rstacruz/REPO)
|
||||||
|
|
||||||
|
CodeClimate (shields.io)
|
||||||
|
[](https://codeclimate.com/github/rstacruz/REPO
|
||||||
|
"CodeClimate")
|
||||||
|
|
||||||
|
Coveralls (shields.io)
|
||||||
|
[](https://coveralls.io/r/rstacruz/REPO)
|
||||||
|
|
||||||
Travis (shields.io)
|
Travis (shields.io)
|
||||||
[](https://travis-ci.org/rstacruz/REPO "See test builds")
|
[](https://travis-ci.org/rstacruz/REPO "See test builds")
|
||||||
|
|
||||||
|
|
33
bootstrap.md
33
bootstrap.md
|
@ -47,3 +47,36 @@ Max:
|
||||||
.hidden-{xs,sm,md,lg}
|
.hidden-{xs,sm,md,lg}
|
||||||
.visible-{xs,sm,md,lg}
|
.visible-{xs,sm,md,lg}
|
||||||
.visible-{xs,sm,md,lg,print}-{block,inline,inline-block}
|
.visible-{xs,sm,md,lg,print}-{block,inline,inline-block}
|
||||||
|
|
||||||
|
### Modal
|
||||||
|
|
||||||
|
<a data-toggle='modal' data-target='#new'>
|
||||||
|
|
||||||
|
#new.modal.fade(role='dialog')
|
||||||
|
.modal-dialog // .modal-lg, .modal-sm
|
||||||
|
.modal-content
|
||||||
|
.modal-header
|
||||||
|
%h4.modal-title hello
|
||||||
|
.modal-body
|
||||||
|
...
|
||||||
|
.modal-footer
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
### Modal via ajax (Rails)
|
||||||
|
|
||||||
|
%button.btn{data: { |
|
||||||
|
toggle: 'modal', |
|
||||||
|
target: '#chooseTheme', |
|
||||||
|
remote: '/path/to/remote'}
|
||||||
|
Change Theme
|
||||||
|
|
||||||
|
.modal.fade#chooseTheme
|
||||||
|
.modal-dialog.modal-xl
|
||||||
|
.modal-content
|
||||||
|
.modal-header
|
||||||
|
%h4.modal-title Choose a theme
|
||||||
|
|
||||||
|
.modal-body
|
||||||
|
.spinner-panel.-lg
|
||||||
|
%i
|
||||||
|
|
|
@ -3,6 +3,8 @@ title: jscoverage
|
||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Also see [mocha-blanket](mocha-blanket.html).
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
|
|
||||||
npm install --save-dev jscoverage
|
npm install --save-dev jscoverage
|
||||||
|
@ -28,4 +30,5 @@ The `coverage` task injects your source files (`lib`) with jscoverage hooks, run
|
||||||
|
|
||||||
### Caveats
|
### Caveats
|
||||||
|
|
||||||
If you're using jsdom, be sure to expose the `window._$jscoverage` variable into the `global` scope.
|
If you're using jsdom, be sure to expose the `window._$jscoverage` variable into
|
||||||
|
the `global` scope.
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
---
|
||||||
|
title: Mocha blanket
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
Use [blanket] for easy coverage reporting.
|
||||||
|
|
||||||
|
## Quickstart guide
|
||||||
|
|
||||||
|
$ npm i --save-dev blanket
|
||||||
|
|
||||||
|
In your test helpers, use Blanket before `require`ing:
|
||||||
|
|
||||||
|
```js
|
||||||
|
if (process.env.COVERAGE) {
|
||||||
|
require('blanket')({
|
||||||
|
pattern: require('path').resolve('./index.js')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
thing = require('../index');
|
||||||
|
```
|
||||||
|
|
||||||
|
## Add scripts to package.json
|
||||||
|
|
||||||
|
Add to `package.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"scripts": {
|
||||||
|
"coverage": "env COVERAGE=1 mocha -R html-cov > coverage.html"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Be sure to ignore it:
|
||||||
|
|
||||||
|
$ echo "coverage.html" >> .gitignore
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
|
||||||
|
$ npm run coverage && open coverage.html
|
||||||
|
|
||||||
|
## Travis + coveralls.io support
|
||||||
|
|
||||||
|
Visit [coveralls.io] then activate your repo. Then install the appropriate packages:
|
||||||
|
|
||||||
|
$ npm i --save-dev mocha-lcov-reporter coveralls
|
||||||
|
|
||||||
|
Add this to `.travis.yml`:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
after_success:
|
||||||
|
- ./node_modules/.bin/mocha -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
|
||||||
|
```
|
||||||
|
|
||||||
|
Commit, push, wait for Travis to finish.
|
||||||
|
|
||||||
|
[blanket]: https://www.npmjs.org/package/blanket
|
||||||
|
[coveralls.io]: http://coveralls.io
|
|
@ -69,7 +69,7 @@ layout: default
|
||||||
⏎ – ⏎ – ⏎ – Return
|
⏎ – ⏎ – ⏎ – Return
|
||||||
⌫ – ⌫ – ⌫ – Delete / Backspace
|
⌫ – ⌫ – ⌫ – Delete / Backspace
|
||||||
|
|
||||||
▸ \u25b8
|
▸ \u25b8 right arrow
|
||||||
▹
|
▹
|
||||||
|
|
||||||
◇ \u25c7
|
◇ \u25c7
|
||||||
|
|
Loading…
Reference in New Issue