Skip to content

Commit

Permalink
adding test for function-parameter context object.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed May 4, 2015
1 parent cc4c1cd commit db3b72f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/formatSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ describe("Method as.func", function () {
};
})).toBe("'one',one");

// testing function-object context;
expect(pgp.as.format("${summ}", {
val1: 1,
val2: 2,
summ: function () {
return this.val1 + this.val2; // `this` must work here;
}
})).toBe("3");

/////////////////////////////
// negative tests;

Expand Down

0 comments on commit db3b72f

Please sign in to comment.