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
d4e2d545
...
d4e2d545104248df5860e9104064af62921848f2
authored
2012-12-28 12:44:01 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
migrated require tests to new testing format
1 parent
60c27d7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
24 deletions
tests/suites/require.js
tests/suites/require.js
View file @
d4e2d54
...
...
@@ -2,30 +2,36 @@
/*jshint strict:false*/
var
fs
=
require
(
'fs'
);
var
modroot
=
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
,
'sample_modules'
);
var
jsmod
,
csmod
,
config
;
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
.
begin
(
'Javascript module loading'
,
1
,
function
(
test
)
{
var
jsmod
;
try
{
jsmod
=
require
(
fs
.
pathJoin
(
modroot
,
'jsmodule'
));
test
.
assertTrue
(
jsmod
.
ok
,
'require() patched version can load a js module'
);
}
catch
(
e
)
{
test
.
fail
(
'require() patched version can load a js module'
);
}
test
.
done
();
});
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
.
begin
(
'CoffeeScript module loading'
,
1
,
function
(
test
)
{
var
csmod
;
try
{
csmod
=
require
(
fs
.
pathJoin
(
modroot
,
'csmodule'
));
test
.
assertTrue
(
csmod
.
ok
,
'require() patched version can load a coffeescript module'
);
}
catch
(
e
)
{
test
.
fail
(
'require() patched version can load a coffeescript module'
);
}
test
.
done
();
});
casper
.
test
.
comment
(
'JSON module loading'
)
try
{
config
=
require
(
fs
.
pathJoin
(
modroot
,
'config.json'
));
casper
.
test
.
assertTrue
(
config
.
ok
,
'require() patched version can load a json module'
);
}
catch
(
e
)
{
casper
.
test
.
fail
(
'require() patched version can load a json module'
);
}
casper
.
test
.
done
(
3
);
casper
.
test
.
begin
(
'JSON module loading'
,
1
,
function
(
test
)
{
var
config
;
try
{
config
=
require
(
fs
.
pathJoin
(
modroot
,
'config.json'
));
test
.
assertTrue
(
config
.
ok
,
'require() patched version can load a json module'
);
}
catch
(
e
)
{
test
.
fail
(
'require() patched version can load a json module'
);
}
test
.
done
();
});
...
...
Please
register
or
sign in
to post a comment