busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

v0.7.4 change log helper is invalid? #383

Closed olance closed 10 years ago

olance commented 10 years ago

The v0.7.4 release notes indicate that:

assert, refute and other globals or gone. Buster only exposes the buster global now.

It then goes on explaining how to specify helpers to get expect and other globals back as an available global helper.

However I found that the helper file should most likely look like this for that workaround to work (for node testing):

var buster = require('buster');

assert = buster.assert;
refute = buster.refute;
expect = buster.expect;

Maybe the change log needs to be updated?

azu commented 10 years ago

:+1:


I use following script which support brower & node.js.

(function (global) {
    if (typeof require == "function" && typeof module == "object") {
        global.buster = require("buster");
    }
    global.assert = buster.assert;
    global.refute = buster.refute;
    global.expect = buster.expect;
})(this.self || global);
olance commented 10 years ago

That looks nicer! :)

dwittner commented 10 years ago

The example in the release notes is for browser testing. The example is just intended to show how assert, refute and expect are exposed. If you need a test helper for node or hybrid testing, you are free to create your own.