Skip to content

Instantly share code, notes, and snippets.

@JohnTigue
JohnTigue / mocha-hooks-sequencing.js
Created April 3, 2015 21:27
Simple test of mocha's before* and after* hooks with some nesting. No async.
'use strict';
/** Drive this via mocha. Simple 101 explorations of the hooks in mocha.
*/
var expect = require('chai').expect;
/** So, just how complicated do the hooks get?
* https://medium.com/@kanyang/hooks-in-mocha-87cb43baa91c
*
@JohnTigue
JohnTigue / mocha-and-use-strict
Created April 3, 2015 21:24
Unexpected behavior from mocha with regards to 'use strict';
/** This file explores unexpected behavior by mocha with regards to strict mode.
* This was only tested on mocha@2.2.1 on OSX 10.8.5
*
* For reference here is the relevant part of the ECMAScript Spec 5.1
* 14.1 Directive Prologues and the Use Strict Directive
* http://www.ecma-international.org/ecma-262/5.1/#sec-14.1
*
* For clarity to distinguish the 2 instances of the Use Strict Directive in this file both variants are used, each once:
* 'use strict';
* "use strict";