Comparing version 0.0.17 to 0.0.18
@@ -133,3 +133,4 @@ // Generated by CoffeeScript 1.9.1 | ||
THEN: Object.keys(spec.THEN || {}), | ||
WHEN: Object.keys(spec.WHEN || {}) | ||
WHEN: Object.keys(spec.WHEN || {}), | ||
TAP: Object.keys(spec.TAP || {}) | ||
}; | ||
@@ -139,3 +140,4 @@ counts = { | ||
WHEN: {}, | ||
THEN: {} | ||
THEN: {}, | ||
TAP: {} | ||
}; | ||
@@ -170,2 +172,11 @@ return { | ||
}, | ||
TAP: { | ||
called: function(description) { | ||
var base; | ||
if ((base = counts.TAP)[description] == null) { | ||
base[description] = 0; | ||
} | ||
return counts.TAP[description]++; | ||
} | ||
}, | ||
getUncovered: function() { | ||
@@ -254,3 +265,3 @@ return { | ||
describeScenario = function(spec, arg) { | ||
var DONE, GIVEN, THEN, WHEN, bdd, counts, getGiven, getThen, getWhen, getter, only, promiseBuilderFactory; | ||
var DONE, GIVEN, THEN, WHEN, bdd, counts, getGiven, getTap, getThen, getWhen, getter, only, promiseBuilderFactory; | ||
only = arg.only, counts = arg.counts; | ||
@@ -261,3 +272,3 @@ GIVEN = spec.GIVEN, WHEN = spec.WHEN, THEN = spec.THEN, DONE = spec.DONE; | ||
var fn; | ||
fn = collection[description]; | ||
fn = typeof description !== 'function' ? collection[description] : description; | ||
if (!fn) { | ||
@@ -289,2 +300,3 @@ throw new Error("'" + name + "' doesn't contain '" + description + "'"); | ||
getThen = getter('THEN', THEN); | ||
getTap = getter('TAP'); | ||
promiseBuilderFactory = function(arg1) { | ||
@@ -395,2 +407,9 @@ var chain; | ||
}, | ||
tap: function() { | ||
var args, fn; | ||
fn = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
return bdd(descriptionBuilder, promiseBuilder.then(function(context) { | ||
return getTap(fn)(context, {}, args); | ||
})); | ||
}, | ||
combine: function(rightBdd) { | ||
@@ -397,0 +416,0 @@ var nextPromiseBuilder; |
{ | ||
"name": "gwt", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "Given, when, then", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
15870
427