Update coverage stuff

This commit is contained in:
Rico Sta. Cruz 2014-11-05 14:14:00 +08:00
parent fd95abaf3c
commit 4c849b6560
5 changed files with 102 additions and 2 deletions

View File

@ -10,6 +10,13 @@ Here are some badges for open source projects.
Travis Travis
[![Status](https://travis-ci.org/rstacruz/REPO.svg?branch=master)](https://travis-ci.org/rstacruz/REPO) [![Status](https://travis-ci.org/rstacruz/REPO.svg?branch=master)](https://travis-ci.org/rstacruz/REPO)
CodeClimate (shields.io)
[![CodeClimate](http://img.shields.io/codeclimate/github/rstacruz/REPO.svg?style=flat)](https://codeclimate.com/github/rstacruz/REPO
"CodeClimate")
Coveralls (shields.io)
[![Coveralls](http://img.shields.io/coveralls/rstacruz/REPO.svg?style=flat)](https://coveralls.io/r/rstacruz/REPO)
Travis (shields.io) Travis (shields.io)
[![Status](http://img.shields.io/travis/rstacruz/REPO/master.svg?style=flat)](https://travis-ci.org/rstacruz/REPO "See test builds") [![Status](http://img.shields.io/travis/rstacruz/REPO/master.svg?style=flat)](https://travis-ci.org/rstacruz/REPO "See test builds")

View File

@ -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

View File

@ -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.

57
mocha-blanket.md Normal file
View File

@ -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

View File

@ -69,7 +69,7 @@ layout: default
&#x23ce; &#9166; Return &#x23ce; &#9166; Return
&#x232b; &#9003; Delete / Backspace &#x232b; &#9003; Delete / Backspace
▸ \u25b8 ▸ \u25b8 right arrow
◇ \u25c7 ◇ \u25c7