Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
1d151ab9
...
1d151ab9c06b167e0bcec3f2d8a94e23b4ab11c3
authored
2012-10-27 22:29:54 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
let's have decent error reporting when new module tests fail
as it's the case atm :)
1 parent
2a362c51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
tests/suites/modules/csmodule.coffee
tests/suites/modules/jsmodule.js
tests/suites/require.js
tests/suites/modules/csmodule.coffee
View file @
1d151ab
exports
.
ok
=
true
try
exports
.
ok
=
true
catch
e
casper
.
test
.
fail
(
'error in coffeescript module code: '
+
e
)
casper
.
test
.
done
()
...
...
tests/suites/modules/jsmodule.js
View file @
1d151ab
exports
.
ok
=
true
/*global casper*/
try
{
exports
.
ok
=
true
;
}
catch
(
e
)
{
casper
.
test
.
fail
(
'error in js module code'
+
e
);
casper
.
test
.
done
()
}
...
...
tests/suites/require.js
View file @
1d151ab
...
...
@@ -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
();
...
...
Please
register
or
sign in
to post a comment