You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Of course, td.replace() only works in Node.js, because quibble is coupled to Node's Module module. However, what if instead of throwing an error, the behavior was changed for browsers?
For instance:
var property = td.replace(some.object, 'property')
property // a test double created with the same rules as td.replace() for node
td.reset() // will restore all the replaced stuff
I like this a lot because it would increase the utility of testdouble.js on projects without marrying us to a module scheme. Conceivably, somebody could build a plugin using this as a primitive to add support for AMD or what-not.
Downsides to using the same td.replace name include possible confusion, however, since the behavior will be so different. I'm sure we could implement it without issue b/c browserify will load a different file, but I'm worried about the risk of confusion to users who might see a snippet or doc in one place which doesn't apply to the context they're using td.js in. JavaScript is hard.
The text was updated successfully, but these errors were encountered:
Of course,
td.replace()
only works in Node.js, because quibble is coupled to Node'sModule
module. However, what if instead of throwing an error, the behavior was changed for browsers?For instance:
I like this a lot because it would increase the utility of testdouble.js on projects without marrying us to a module scheme. Conceivably, somebody could build a plugin using this as a primitive to add support for AMD or what-not.
Downsides to using the same
td.replace
name include possible confusion, however, since the behavior will be so different. I'm sure we could implement it without issue b/c browserify will load a different file, but I'm worried about the risk of confusion to users who might see a snippet or doc in one place which doesn't apply to the context they're using td.js in. JavaScript is hard.The text was updated successfully, but these errors were encountered: