Comparing version 2.1.1 to 2.1.2
@@ -219,4 +219,12 @@ /*! | ||
(function(propertyKey) { | ||
var propertyIsSet = false, | ||
propertyValue; | ||
Object.defineProperty(fake, key, { | ||
get: function() { | ||
if (propertyIsSet) { | ||
return propertyValue; | ||
} | ||
throw new Error('Unexpected use of property "' + propertyKey + '".'); | ||
@@ -226,4 +234,10 @@ }, | ||
// when set, change into a data property - removes the getter and setter | ||
Object.defineProperty(fake, key, { value: value }); | ||
propertyIsSet = true; | ||
propertyValue = value; | ||
// if not for https://github.com/box/leche/issues/14, we could do this | ||
// Object.defineProperty(this, key, { | ||
// value: value, | ||
// writable: true | ||
// }); | ||
}, | ||
@@ -230,0 +244,0 @@ enumerable: true, |
@@ -17,2 +17,2 @@ /*! | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.leche=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";require("mocha");function isAccessorProperty(object,key){var result=false;if(Object.getOwnPropertyDescriptor&&object.hasOwnProperty(key)){var descriptor=Object.getOwnPropertyDescriptor(object,key);result=!("value"in descriptor)}return result}function isES5DataProperty(object,key){var result=false;if(Object.getOwnPropertyDescriptor&&object.hasOwnProperty(key)){var descriptor=Object.getOwnPropertyDescriptor(object,key);result="value"in descriptor&&typeof descriptor.value!=="function"}return result}function isES3DataProperty(object,key){return typeof object[key]!=="function"}function createObject(proto){function F(){}F.prototype=proto;return new F}function createNamedDataset(array){var result={};for(var i=0,len=array.length;i<len;i++){result[array[i].toString()]=array[i]}return result}function noop(){}module.exports={create:function(methods){var object={};for(var i=0,len=methods.length;i<len;i++){object[methods[i]]=noop}return object},fake:function(template){var fake=createObject(template);for(var key in fake){if(isAccessorProperty(template,key)){Object.defineProperty(fake,key,{value:undefined,writable:true,enumerable:true,configurable:true})}else if(isES5DataProperty(template,key)){(function(propertyKey){Object.defineProperty(fake,key,{get:function(){throw new Error('Unexpected use of property "'+propertyKey+'".')},set:function(value){Object.defineProperty(fake,key,{value:value})},enumerable:true,configurable:true})})(key)}else if(isES3DataProperty(template,key)){fake[key]=undefined}else if(typeof fake[key]==="function"){fake[key]=function(methodKey){return function(){throw new Error('Unexpected call to method "'+methodKey+'".')}}(key)}}return fake},withData:function(dataset,testFunction){if(typeof dataset!=="object"||dataset===null){throw new Error("First argument must be an object or non-empty array.")}var namedDataset=dataset;if(dataset instanceof Array){if(dataset.length){namedDataset=createNamedDataset(dataset)}else{throw new Error("First argument must be an object or non-empty array.")}}for(var name in namedDataset){if(namedDataset.hasOwnProperty(name)){describe("with "+name,function(dataName){return function(){var args=namedDataset[dataName];if(!(args instanceof Array)){args=[args]}testFunction.apply(this,args)}}(name))}}}}},{mocha:2}],2:[function(require,module,exports){},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.leche=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";require("mocha");function isAccessorProperty(object,key){var result=false;if(Object.getOwnPropertyDescriptor&&object.hasOwnProperty(key)){var descriptor=Object.getOwnPropertyDescriptor(object,key);result=!("value"in descriptor)}return result}function isES5DataProperty(object,key){var result=false;if(Object.getOwnPropertyDescriptor&&object.hasOwnProperty(key)){var descriptor=Object.getOwnPropertyDescriptor(object,key);result="value"in descriptor&&typeof descriptor.value!=="function"}return result}function isES3DataProperty(object,key){return typeof object[key]!=="function"}function createObject(proto){function F(){}F.prototype=proto;return new F}function createNamedDataset(array){var result={};for(var i=0,len=array.length;i<len;i++){result[array[i].toString()]=array[i]}return result}function noop(){}module.exports={create:function(methods){var object={};for(var i=0,len=methods.length;i<len;i++){object[methods[i]]=noop}return object},fake:function(template){var fake=createObject(template);for(var key in fake){if(isAccessorProperty(template,key)){Object.defineProperty(fake,key,{value:undefined,writable:true,enumerable:true,configurable:true})}else if(isES5DataProperty(template,key)){(function(propertyKey){var propertyIsSet=false,propertyValue;Object.defineProperty(fake,key,{get:function(){if(propertyIsSet){return propertyValue}throw new Error('Unexpected use of property "'+propertyKey+'".')},set:function(value){propertyIsSet=true;propertyValue=value},enumerable:true,configurable:true})})(key)}else if(isES3DataProperty(template,key)){fake[key]=undefined}else if(typeof fake[key]==="function"){fake[key]=function(methodKey){return function(){throw new Error('Unexpected call to method "'+methodKey+'".')}}(key)}}return fake},withData:function(dataset,testFunction){if(typeof dataset!=="object"||dataset===null){throw new Error("First argument must be an object or non-empty array.")}var namedDataset=dataset;if(dataset instanceof Array){if(dataset.length){namedDataset=createNamedDataset(dataset)}else{throw new Error("First argument must be an object or non-empty array.")}}for(var name in namedDataset){if(namedDataset.hasOwnProperty(name)){describe("with "+name,function(dataName){return function(){var args=namedDataset[dataName];if(!(args instanceof Array)){args=[args]}testFunction.apply(this,args)}}(name))}}}}},{mocha:2}],2:[function(require,module,exports){},{}]},{},[1])(1)}); |
@@ -116,2 +116,4 @@ /** | ||
execOrExit('npm version ' + type); | ||
target.generateDist(); | ||
@@ -122,4 +124,2 @@ | ||
execOrExit('npm version ' + type); | ||
// ...and publish | ||
@@ -126,0 +126,0 @@ execOrExit('git push origin master --tags'); |
{ | ||
"name": "leche", | ||
"author": "nzakas", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "A JavaScript testing utility designed to work with Mocha and Sinon", | ||
@@ -28,3 +28,3 @@ "main": "./lib/leche.js", | ||
"peerDependencies": { | ||
"mocha": ">=1.18 <3" | ||
"mocha": ">=1.18 <4" | ||
}, | ||
@@ -38,11 +38,10 @@ "devDependencies": { | ||
"jsonlint": "^1.6.2", | ||
"mocha": "^2.1.0", | ||
"mocha-phantomjs": "^3.5.3", | ||
"mocha": "^3.0.2", | ||
"mocha-phantomjs": "^4.1.0", | ||
"mockery": "~1.4", | ||
"phantomjs": "^1.9.15", | ||
"shelljs": "^0.3.0", | ||
"shelljs-nodecli": "^0.1.1", | ||
"sinon": "^1.12.2", | ||
"sinon": "1.17.5", | ||
"uglify-js": "^2.4.16" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62131
13
998
1