Skip to content

Instantly share code, notes, and snippets.

@trentm
Created December 5, 2011 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trentm/1435063 to your computer and use it in GitHub Desktop.
Save trentm/1435063 to your computer and use it in GitHub Desktop.
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])
@isaacs
Copy link

isaacs commented Dec 6, 2011

Can you express this in the form of a pull request, where the commit contains the words Fix #24?

@isaacs
Copy link

isaacs commented Dec 6, 2011

Also, bonus points if you can add a test for it. There's some test checking stuff in (i think?) meta-test.js

@trentm
Copy link
Author

trentm commented Dec 6, 2011 via email

@trentm
Copy link
Author

trentm commented Dec 7, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment