Skip to content

Commit 79fd7e9

Browse files
committed
Add phantomjs as build dependency to npm, fix crash on local machine
1 parent 12b1f10 commit 79fd7e9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/bash
22
set -e
33

4+
path="./node_modules/.bin:$PATH"
5+
46
function installDependencies {
57
npm install
68
}
79

810
function build {
9-
./node_modules/.bin/grunt $@
11+
PATH=$path grunt $@
1012
}
1113

1214
function runCSSTest {
@@ -15,20 +17,20 @@ function runCSSTest {
1517
mkdir -p "${BUILD_DIR}"
1618

1719
# workaround for csscritic currently needing to be called twice
18-
phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html || phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html
20+
PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html || PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html
1921

2022
echo -e "\033[32m\033[1mAll UI tests are passing\033[0m\n"
2123

2224
echo "Now make sure that the fingerprints are up-to-date so we don't push something that travis is unable to check"
2325
mv test/ui/*.html.json "${BUILD_DIR}"
2426
# again, workaround for csscritic currently needing to be called twice
25-
phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html || phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html
27+
PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html || PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html
2628
}
2729

2830
function checkExample {
2931
echo -e "\nChecking example"
3032
rm -f example/pageUnderTest.html.json
31-
phantomjs test/run-csscritic-phantom.js -f example/signedOff.json example/pageUnderTest.html || phantomjs test/run-csscritic-phantom.js -f example/signedOff.json example/pageUnderTest.html
33+
PATH=$path phantomjs test/run-csscritic-phantom.js -f example/signedOff.json example/pageUnderTest.html || PATH=$path phantomjs test/run-csscritic-phantom.js -f example/signedOff.json example/pageUnderTest.html
3234
}
3335

3436
if [ ! -d node_modules ]; then

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"grunt-umd": "~1.7.3",
4343
"jasmine-core": "2.0.0",
4444
"jasmine-jquery": "git://github.com/velesin/jasmine-jquery",
45-
"jquery": "~2.1.0"
45+
"jquery": "~2.1.0",
46+
"phantomjs": "1.9.8"
4647
},
4748
"scripts": {
4849
"test": "bash go --verbose"

0 commit comments

Comments
 (0)