mirror of
https://github.com/google/blockly.git
synced 2026-01-15 12:57:12 +01:00
Add a test script to compile typings and test on travis (#2808)
This commit is contained in:
@@ -67,6 +67,9 @@ run_test_command "node" "./node_modules/.bin/mocha tests/node --opts tests/node/
|
||||
# Run generator tests inside a browser and check the results.
|
||||
run_test_command "generators" "tests/scripts/run_generators.sh"
|
||||
|
||||
# Generate TypeScript typings and ensure there are no errors.
|
||||
run_test_command "typings" "tests/scripts/compile_typings.sh"
|
||||
|
||||
# # Attempt advanced compilation of a Blockly app.
|
||||
# run_test_command "compile" "tests/compile/compile.sh"
|
||||
|
||||
|
||||
29
tests/scripts/compile_typings.sh
Executable file
29
tests/scripts/compile_typings.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ANSI colors
|
||||
BOLD_GREEN='\033[1;32m'
|
||||
BOLD_RED='\033[1;31m'
|
||||
ANSI_RESET='\033[0m'
|
||||
|
||||
# Download TypeScript to obtain the compiler.
|
||||
echo "Downloading TypeScript"
|
||||
npm install typescript
|
||||
|
||||
# Generate Blockly typings.
|
||||
echo "Generating Blockly typings"
|
||||
npm run typings
|
||||
|
||||
# Use the TypeScript compiler to compile the generated typings.
|
||||
echo "Compiling typings"
|
||||
cd typings
|
||||
../node_modules/.bin/tsc blockly.d.ts
|
||||
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo -e "${BOLD_GREEN}TypeScript typings compiled successfully.${ANSI_RESET}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${BOLD_RED}Failed to compile TypeScript typings.${ANSI_RESET}" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user