Created
December 5, 2011 19:52
-
-
Save trentm/1435063 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: /Users/trentm/src/node-tap/lib/tap-harness.js | |
index 5083aba..3f6b541 100644 | |
--- a/lib/tap-harness.js | |
+++ b/lib/tap-harness.js | |
@@ -142,6 +142,12 @@ Harness.prototype.childEnd = function (child) { | |
} | |
} | |
+function copyObj(o) { | |
+ var copied = {}; | |
+ Object.keys(o).forEach(function (k) { copied[k] = o[k] }); | |
+ return copied; | |
+} | |
+ | |
Harness.prototype.test = function test (name, conf, cb) { | |
if (this._bailedOut) return | |
@@ -149,7 +155,7 @@ Harness.prototype.test = function test (name, conf, cb) { | |
if (typeof name === "object") conf = name, name = null | |
if (typeof name === "function") cb = name, name = null | |
- conf = conf || {} | |
+ conf = (conf ? copyObj(conf) : {}) | |
name = name || "" | |
//console.error("making test", [name, conf, cb]) |
Also, bonus points if you can add a test for it. There's some test checking stuff in (i think?) meta-test.js
yup will do
On Tue, Dec 6, 2011 at 11:51 AM, Isaac Z. Schlueter ***@***.*** wrote:
Also, bonus points if you can add a test for it. There's some test checking stuff in (i think?) meta-test.js
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1435063
##
Trent Mick
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you express this in the form of a pull request, where the commit contains the words
Fix #24
?