let's have decent error reporting when new module tests fail
as it's the case atm :)
Showing
3 changed files
with
28 additions
and
6 deletions
... | @@ -2,10 +2,22 @@ | ... | @@ -2,10 +2,22 @@ |
2 | /*jshint strict:false*/ | 2 | /*jshint strict:false*/ |
3 | var fs = require('fs'); | 3 | var fs = require('fs'); |
4 | var modroot = fs.pathJoin(phantom.casperPath, 'tests', 'suites', 'modules'); | 4 | var modroot = fs.pathJoin(phantom.casperPath, 'tests', 'suites', 'modules'); |
5 | var jsmod = require(fs.pathJoin(modroot, 'jsmodule')); | 5 | var jsmod, csmod; |
6 | var csmod = require(fs.pathJoin(modroot, 'csmodule')); | ||
7 | 6 | ||
8 | casper.test.assertTrue(jsmod.ok, 'require() patched version can load a js module'); | 7 | casper.test.comment('Javascript module loading') |
9 | casper.test.assertTrue(csmod.ok, 'require() patched version can load a coffeescript module'); | 8 | try { |
9 | jsmod = require(fs.pathJoin(modroot, 'jsmodule')); | ||
10 | casper.test.assertTrue(jsmod.ok, 'require() patched version can load a js module'); | ||
11 | } catch (e) { | ||
12 | casper.test.fail('require() patched version can load a js module'); | ||
13 | } | ||
14 | |||
15 | casper.test.comment('CoffeeScript module loading') | ||
16 | try { | ||
17 | csmod = require(fs.pathJoin(modroot, 'csmodule')); | ||
18 | casper.test.assertTrue(csmod.ok, 'require() patched version can load a coffeescript module'); | ||
19 | } catch (e) { | ||
20 | casper.test.fail('require() patched version can load a coffeescript module'); | ||
21 | } | ||
10 | 22 | ||
11 | casper.test.done(); | 23 | casper.test.done(); | ... | ... |
-
Please register or sign in to post a comment