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
0ac8c4de
...
0ac8c4dec5ada57e6b8875530c23c7180bd4acc1
authored
2012-01-11 09:33:50 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
changed 'casperjs --run-tests' command for a more obvious 'casperjs test [path]'
1 parent
18a56414
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
0ac8c4d
...
...
@@ -28,7 +28,7 @@
*
*/
if
(
!
phantom
.
casperLoaded
)
{
phantom
.
loadCasper
=
function
(
)
{
// see http://semver.org/
phantom
.
casperVersion
=
{
major
:
0
,
...
...
@@ -108,7 +108,7 @@ if (!phantom.casperLoaded) {
// Stack formatting
window
.
CasperError
.
prototype
.
formatStack
=
function
()
{
var
location
=
this
.
fileName
||
phantom
.
sourceIds
[
this
.
sourceId
]
||
"unknown"
;
location
+=
this
.
line
?
':'
+
this
.
line
:
0
;
location
+=
':'
+
(
this
.
line
?
this
.
line
:
0
)
;
return
this
.
toString
()
+
'\n '
+
(
this
.
_from
||
"anonymous"
)
+
'() at '
+
location
;
};
...
...
@@ -258,17 +258,30 @@ if (!phantom.casperLoaded) {
// loaded status
phantom
.
casperLoaded
=
true
;
};
if
(
!
phantom
.
casperLoaded
)
{
try
{
phantom
.
loadCasper
();
}
catch
(
e
)
{
console
.
error
(
"Unable to load casper environment: "
+
e
);
phantom
.
exit
();
}
}
var
fs
=
require
(
"fs"
);
if
(
!!
phantom
.
casperArgs
.
options
.
version
)
{
console
.
log
(
phantom
.
casperVersion
.
toString
());
phantom
.
exit
(
0
);
}
else
if
(
!!
phantom
.
casperArgs
.
get
(
'run-tests'
)
)
{
}
else
if
(
phantom
.
casperArgs
.
get
(
0
)
===
"test"
)
{
phantom
.
casperScript
=
fs
.
absolute
(
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
,
'run.js'
));
}
else
if
(
phantom
.
casperArgs
.
args
.
length
===
0
||
!!
phantom
.
casperArgs
.
options
.
help
)
{
var
phantomVersion
=
[
phantom
.
version
.
major
,
phantom
.
version
.
minor
,
phantom
.
version
.
patch
].
join
(
'.'
);
console
.
log
(
'CasperJS version '
+
phantom
.
casperVersion
.
toString
()
+
' at '
+
phantom
.
casperPath
);
console
.
log
(
'Using PhantomJS version '
+
phantomVersion
);
var
f
=
require
(
"utils"
).
format
;
console
.
log
(
f
(
'CasperJS version %s at %s, using PhantomJS version %s'
,
phantom
.
casperVersion
.
toString
(),
phantom
.
casperPath
,
phantomVersion
));
console
.
log
(
fs
.
read
(
fs
.
pathJoin
(
phantom
.
casperPath
,
'bin'
,
'usage.txt'
)));
phantom
.
exit
(
0
);
}
...
...
@@ -283,9 +296,7 @@ if (!fs.isFile(phantom.casperScript)) {
}
// filter out the called script name from casper args
phantom
.
casperArgs
.
args
=
phantom
.
casperArgs
.
args
.
filter
(
function
(
arg
)
{
return
arg
!==
phantom
.
casperScript
;
});
phantom
.
casperArgs
.
drop
(
phantom
.
casperScript
);
// passed casperjs script execution
try
{
...
...
Please
register
or
sign in
to post a comment