Commit 1d151ab9 1d151ab9c06b167e0bcec3f2d8a94e23b4ab11c3 by Nicolas Perriault

let's have decent error reporting when new module tests fail

as it's the case atm :)
1 parent 2a362c51
exports.ok = true
try
exports.ok = true
catch e
casper.test.fail('error in coffeescript module code: ' + e)
casper.test.done()
......
exports.ok = true
/*global casper*/
try {
exports.ok = true;
} catch (e) {
casper.test.fail('error in js module code' + e);
casper.test.done()
}
......
......@@ -2,10 +2,22 @@
/*jshint strict:false*/
var fs = require('fs');
var modroot = fs.pathJoin(phantom.casperPath, 'tests', 'suites', 'modules');
var jsmod = require(fs.pathJoin(modroot, 'jsmodule'));
var csmod = require(fs.pathJoin(modroot, 'csmodule'));
var jsmod, csmod;
casper.test.assertTrue(jsmod.ok, 'require() patched version can load a js module');
casper.test.assertTrue(csmod.ok, 'require() patched version can load a coffeescript module');
casper.test.comment('Javascript module loading')
try {
jsmod = require(fs.pathJoin(modroot, 'jsmodule'));
casper.test.assertTrue(jsmod.ok, 'require() patched version can load a js module');
} catch (e) {
casper.test.fail('require() patched version can load a js module');
}
casper.test.comment('CoffeeScript module loading')
try {
csmod = require(fs.pathJoin(modroot, 'csmodule'));
casper.test.assertTrue(csmod.ok, 'require() patched version can load a coffeescript module');
} catch (e) {
casper.test.fail('require() patched version can load a coffeescript module');
}
casper.test.done();
......