Dotawo/node_modules/import/test/load-test.js

24 lines
547 B
JavaScript
Raw Normal View History

2020-10-28 23:37:25 +01:00
var vows = require("vows"),
assert = require("assert"),
smash = require("../");
var suite = vows.describe("smash.load");
suite.addBatch({
"load": {
"on a simple file": {
topic: function() {
smash.load(["test/data/forty-two"], "foo", this.callback);
},
"returns the evaluated expression": function(foo) {
assert.strictEqual(foo, 42);
},
"does not pollute the global namespace": function(foo) {
assert.equal(typeof bar, "undefined");
}
}
}
});
suite.export(module);