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
67db3a36
...
67db3a36d229438b13c64138b3caa86974589437
authored
2013-08-02 17:11:57 -0600
by
hexid
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Create setScriptBaseDir(scriptName) to fix jshint tests
1 parent
ecb8b67e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
bin/bootstrap.js
bin/bootstrap.js
View file @
67db3a3
...
...
@@ -227,17 +227,21 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
function
initCasperCli
(
casperArgs
)
{
var
baseTestsPath
=
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
);
function
setScriptBaseDir
(
scriptName
)
{
var
dir
=
fs
.
dirname
(
scriptName
);
if
(
dir
===
scriptName
)
{
dir
=
'.'
;
}
phantom
.
casperScriptBaseDir
=
dir
;
}
if
(
!!
casperArgs
.
options
.
version
)
{
return
__terminate
(
phantom
.
casperVersion
.
toString
())
}
else
if
(
casperArgs
.
get
(
0
)
===
"test"
)
{
phantom
.
casperScript
=
fs
.
absolute
(
fs
.
pathJoin
(
baseTestsPath
,
'run.js'
));
phantom
.
casperTest
=
true
;
casperArgs
.
drop
(
"test"
);
var
scriptDir
=
fs
.
dirname
(
casperArgs
.
get
(
0
));
if
(
scriptDir
===
casperArgs
.
get
(
0
))
{
scriptDir
=
'.'
;
}
phantom
.
casperScriptBaseDir
=
scriptDir
;
setScriptBaseDir
(
casperArgs
.
get
(
0
));
}
else
if
(
casperArgs
.
get
(
0
)
===
"selftest"
)
{
phantom
.
casperScript
=
fs
.
absolute
(
fs
.
pathJoin
(
baseTestsPath
,
'run.js'
));
phantom
.
casperSelfTest
=
phantom
.
casperTest
=
true
;
...
...
@@ -260,11 +264,7 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
}
if
(
!
phantom
.
casperScriptBaseDir
)
{
var
scriptDir
=
fs
.
dirname
(
phantom
.
casperScript
);
if
(
scriptDir
===
phantom
.
casperScript
)
{
scriptDir
=
'.'
;
}
phantom
.
casperScriptBaseDir
=
fs
.
absolute
(
scriptDir
);
setScriptBaseDir
(
phantom
.
casperScript
);
}
// filter out the called script name from casper args
...
...
Please
register
or
sign in
to post a comment