I hereby claim:
- I am mroderick on github.
- I am mrgnrdrck (https://keybase.io/mrgnrdrck) on keybase.
- I have a public key whose fingerprint is 3ABC 8817 CF95 2AF1 78E1 0115 19F2 57E0 CF18 1A69
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var o = {hello:'world', greetings: ['one', 'two', 'three']}; | |
undefined | |
// regular, difficult to read for large objects | |
JSON.stringify(o); | |
"{"hello":"world","greetings":["one","two","three"]}" | |
// presto! | |
JSON.stringify(o, '', ' '); | |
"{ |
In no particular order, except the first one ;-)
describe('this should cause tests to fail', function(){ | |
// this will cause an exception | |
// causing mocha to ignore this whole file | |
var hello = JSON.parse('{"hello":}'); | |
it('should something', function(){ | |
// magic | |
assert.equal(true, true); | |
}) | |
}); |
When I am king™, this will be curriculum for frontend developers.
If everyone would read these books, many discussions could be avoided, and the ones we would have would be a lot more interesting.
These diagrams show how the Sinon family of libraries depend on each other.
devDependencies
are omitted, as they can be considering "internal", and shouldn't be installed by end users of sinon
or referee
┌────────────────────────┐
│ @sinonjs/commons │◀──────────────────────────────────────────────────┐
#!/bin/bash | |
# if there are no staged changes, we can exit immediately | |
# this is fast and prevents issues when popping a stash we didn't create | |
STAGED_CHANGES=`git diff-index --cached HEAD --name-only --diff-filter ACMR` | |
if [ -z "$STAGED_CHANGES" ]; then | |
exit 0 | |
fi |
'use strict'; | |
const sinon = require( 'sinon' ); | |
const expect = require( 'chai' ).expect; | |
describe( 'Array.prototype', () => { | |
describe( 'map()', () => { | |
it( 'uses native map', () => { | |
const callback = sinon.spy(); | |
const stub = sinon.stub( Array.prototype, 'map' ).returns( [ 2, 4 ] ); |