prepack/scripts/test-node-cli-mode.sh
Sebastian Markbage 74b64c89da Add minimal test case for the node-cli mode
I enable this mode only on CI for now. Not to `yarn test`. Since it is
locked to a particular version of Node so we don't want to force people
to run it locally.
2017-05-18 15:08:39 -07:00

18 lines
597 B
Bash

# Prepack test input
node ./bin/prepack.js ./test/node-cli/Simple.js --out Simple-test.js --compatibility node-cli
# Run the resulting program and check it for expected output
node ./Simple-test.js | grep "Hey world" > /dev/null
if [[ $? -ne 0 ]]; then
exit 1
fi
rm ./Simple-test.js
# Prepack test input
node ./bin/prepack.js ./test/node-cli/FileSystem.js --out FileSystem-test.js --compatibility node-cli
# Run the resulting program and check it for expected output
node ./FileSystem-test.js | grep "Hey Hello world" > /dev/null
if [[ $? -ne 0 ]]; then
exit 1
fi
rm ./FileSystem-test.js