mirror of
https://github.com/encounter/phantomjs.git
synced 2026-03-30 11:35:11 -07:00
b6102d7f6e
This is mostly based on Ivan's work, see https://github.com/ariya/phantomjs/pull/153 http://code.google.com/p/phantomjs/issues/detail?id=47
19 lines
541 B
JavaScript
19 lines
541 B
JavaScript
describe("module loading using require", function() {
|
|
|
|
it("should work for 'webpage' module", function() {
|
|
expect(typeof require('webpage')).toEqual('object');
|
|
});
|
|
|
|
it("should work for 'fs' module", function() {
|
|
expect(typeof require('fs')).toEqual('object');
|
|
});
|
|
|
|
it("should throw an error for an unknown module", function() {
|
|
var module = 'foobar';
|
|
expect(function(){
|
|
var foo = require(module);
|
|
}).toThrow("Unknown module " + module + " for require()");
|
|
});
|
|
|
|
});
|