From 7228698be53e771006ee36cbf0638e037746c023 Mon Sep 17 00:00:00 2001 From: bspates Date: Mon, 4 Apr 2016 19:00:42 -0700 Subject: rename test file from intialParams to ensureAsync --- mocha_test/ensureAsync.js | 26 ++++++++++++++++++++++++++ mocha_test/initialParams.js | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 mocha_test/ensureAsync.js delete mode 100644 mocha_test/initialParams.js diff --git a/mocha_test/ensureAsync.js b/mocha_test/ensureAsync.js new file mode 100644 index 0000000..2cfc749 --- /dev/null +++ b/mocha_test/ensureAsync.js @@ -0,0 +1,26 @@ +import initialParams from '../lib/internal/initialParams'; +var expect = require('chai').expect; + +describe('initialParams', function() { + it('should curry any bound context to the wrapped function', function() { + var passContext = function(args, cb) { + cb(this); + }; + + // call bind after wrapping with initialParams + var contextOne = {context: "one"}; + var postBind = initialParams(passContext); + postBind = postBind.bind(contextOne); + postBind([], function(ref) { + expect(ref).to.equal(contextOne); + }); + + // call bind before wrapping with initialParams + var contextTwo = {context: "two"}; + var preBind = passContext.bind(contextTwo); + preBind = initialParams(preBind); + preBind([], function(ref) { + expect(ref).to.equal(contextTwo); + }); + }); +}); diff --git a/mocha_test/initialParams.js b/mocha_test/initialParams.js deleted file mode 100644 index 2cfc749..0000000 --- a/mocha_test/initialParams.js +++ /dev/null @@ -1,26 +0,0 @@ -import initialParams from '../lib/internal/initialParams'; -var expect = require('chai').expect; - -describe('initialParams', function() { - it('should curry any bound context to the wrapped function', function() { - var passContext = function(args, cb) { - cb(this); - }; - - // call bind after wrapping with initialParams - var contextOne = {context: "one"}; - var postBind = initialParams(passContext); - postBind = postBind.bind(contextOne); - postBind([], function(ref) { - expect(ref).to.equal(contextOne); - }); - - // call bind before wrapping with initialParams - var contextTwo = {context: "two"}; - var preBind = passContext.bind(contextTwo); - preBind = initialParams(preBind); - preBind([], function(ref) { - expect(ref).to.equal(contextTwo); - }); - }); -}); -- cgit v1.2.1