Skip to content

Instantly share code, notes, and snippets.

View davyboyhayes's full-sized avatar

David Hayes davyboyhayes

  • Adobe
  • Edinburgh
View GitHub Profile
(function(jasmine){
var protectedVariables = {};
var oldJasmineIt = it;
/**
* This should be used to protect and tear down any variables inside a test class (not a beforeEach/afterEach function)
* that you would typically store, then reset back to the stored values. It helps to reduce some noise in tests
* @param protectedList
*/
jasmine.protect = function(protectedList, fn) {
if (typeof protectedList.length !== 'number') {