mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
Summary: running `yarn run test-std-in` no longer produces output ending in "Error: Fatal ..." Closes https://github.com/facebook/prepack/pull/810 Differential Revision: D5420702 Pulled By: cblappert fbshipit-source-id: 7628419dfb16597fef93a1a4b3bcb8f0d1fbd0bb
23 lines
802 B
Bash
23 lines
802 B
Bash
# Prepack test input
|
|
cat ./test/std-in/StdIn.js | node ./bin/prepack.js --out StdIn-test.js
|
|
# Run the resulting program and check it for expected output
|
|
node ./StdIn-test.js | grep "Hello world from std-in!" > /dev/null
|
|
if [[ $? -ne 0 ]]; then
|
|
exit 1
|
|
fi
|
|
rm ./StdIn-test.js
|
|
|
|
# Prepack test empty input and check if it logs correct msg
|
|
echo "" | node ./bin/prepack.js --out StdIn-test.js | grep "No source code to prepack" > /dev/null
|
|
if [[ $? -ne 0 ]]; then
|
|
exit 1
|
|
fi
|
|
|
|
# Prepack test input and check if it exits with signal 1
|
|
cat ./test/std-in/StdInError.js | node ./bin/prepack.js --out StdInError-test.js 2> /dev/null
|
|
if [[ $? -ne 1 ]]; then
|
|
# If the test failed, rerun and show the output
|
|
cat ./test/std-in/StdInError.js | node ./bin/prepack.js --out StdInError-test.js
|
|
exit 1
|
|
fi
|