From 4c849b65603abc5af0542e4e1e23185c8788be70 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Wed, 5 Nov 2014 14:14:00 +0800 Subject: [PATCH] Update coverage stuff --- badges.md | 7 ++++++ bootstrap.md | 33 ++++++++++++++++++++++++++++ jscoverage.md | 5 ++++- mocha-blanket.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ unicode.md | 2 +- 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 mocha-blanket.md diff --git a/badges.md b/badges.md index db06452ee..ccef9d27e 100644 --- a/badges.md +++ b/badges.md @@ -10,6 +10,13 @@ Here are some badges for open source projects. Travis [![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) [![Status](http://img.shields.io/travis/rstacruz/REPO/master.svg?style=flat)](https://travis-ci.org/rstacruz/REPO "See test builds") diff --git a/bootstrap.md b/bootstrap.md index f60a13e17..13838cff7 100644 --- a/bootstrap.md +++ b/bootstrap.md @@ -47,3 +47,36 @@ Max: .hidden-{xs,sm,md,lg} .visible-{xs,sm,md,lg} .visible-{xs,sm,md,lg,print}-{block,inline,inline-block} + +### Modal + + + + #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 diff --git a/jscoverage.md b/jscoverage.md index 95efd6b97..2faa05cd8 100644 --- a/jscoverage.md +++ b/jscoverage.md @@ -3,6 +3,8 @@ title: jscoverage layout: default --- +Also see [mocha-blanket](mocha-blanket.html). + ### Install npm install --save-dev jscoverage @@ -28,4 +30,5 @@ The `coverage` task injects your source files (`lib`) with jscoverage hooks, run ### 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. diff --git a/mocha-blanket.md b/mocha-blanket.md new file mode 100644 index 000000000..951b9c039 --- /dev/null +++ b/mocha-blanket.md @@ -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 \ No newline at end of file diff --git a/unicode.md b/unicode.md index eed00e7c0..a1c17f19d 100644 --- a/unicode.md +++ b/unicode.md @@ -69,7 +69,7 @@ layout: default ⏎ – ⏎ – ⏎ – Return ⌫ – ⌫ – ⌫ – Delete / Backspace - ▸ \u25b8 + ▸ \u25b8 right arrow ▹ ◇ \u25c7