cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

Simplify decorator testing #304

Closed briancavalier closed 10 years ago

briancavalier commented 10 years ago

Now that nearly all features, except those that are core ES6, have been moved to decorators, it'd be nice to switch to the more isolated style of decorator testing used in inspect-test. Basically, get a Promise constructor and decorate it with only the functionality you are testing.

The rub is that decorators typically modify Promise.prototype directly. So each test would need to load lib/makePromise and call it to create a new Promise constructor. Then they could decorate that safely and test it.

briancavalier commented 10 years ago

Closing this since it's something ongoing. I think it's the right approach, so all new tests should be written this way whenever possible.