Repository navigation
Expand file tree
/
Copy pathgo
More file actions
executable file
·42 lines (32 loc) · 1.41 KB
/
Copy pathgo
File metadata and controls
executable file
·42 lines (32 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -e
function installDependencies {
npm install
}
function build {
./node_modules/.bin/grunt $@
}
function runCSSTest {
DATE=$(date "+%Y-%m-%dT%H:%M:%S")
BUILD_DIR="./build/${DATE}"
mkdir -p "${BUILD_DIR}"
# workaround for csscritic currently needing to be called twice
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
echo -e "\033[32m\033[1mAll UI tests are passing\033[0m\n"
echo "Now make sure that the fingerprints are up-to-date so we don't push something that travis is unable to check"
mv test/ui/*.html.json "${BUILD_DIR}"
# again, workaround for csscritic currently needing to be called twice
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
}
function checkExample {
echo -e "\nChecking example"
rm -f example/pageUnderTest.html.json
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
}
if [ ! -d node_modules ]; then
installDependencies
fi
build
runCSSTest
checkExample
echo -e "\n\033[32m\033[1mLooking good!\033[0m"