test(language-service): test @angular/language-service can be loaded by tsserver.js (#14721)

This commit is contained in:
Chuck Jazdzewski
2017-03-01 13:22:46 -08:00
committed by Igor Minar
parent 79fc1e3959
commit 7a66a4115b
21 changed files with 833 additions and 0 deletions

View File

@ -0,0 +1,2 @@
TYPESCRIPTS=2.3
FIXTURES="smokeTest getCompletions"

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex -o pipefail
cd `dirname $0`
cd ..
source scripts/env.sh
# Setup TypeScripts
for TYPESCRIPT in ${TYPESCRIPTS[@]}
do
(
cd typescripts/$TYPESCRIPT
yarn
)
done

View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -ex -o pipefail
cd `dirname $0`
cd ..
source scripts/env.sh
HOST="node tools/typescript_host.js"
VALIDATE="node tools/typescript_validator.js"
for TYPESCRIPT in ${TYPESCRIPTS[@]}
do
SERVER="node typescripts/$TYPESCRIPT/node_modules/typescript/lib/tsserver.js"
for FIXTURE_BASE in ${FIXTURES[@]}
do
FIXTURE=fixtures/$FIXTURE_BASE.json
EXPECTED=fixtures/$FIXTURE_BASE-expected-$TYPESCRIPT.json
if [[ ${UPDATE_GOLDEN} == true ]]; then
$HOST --file $FIXTURE --pwd $(pwd) | $SERVER | $VALIDATE --golden > $EXPECTED
else
$HOST --file $FIXTURE --pwd $(pwd) | $SERVER | $VALIDATE --expect $EXPECTED
fi
done
done

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -ex -o pipefail
cd `dirname $0`
cd ..
UPDATE_GOLDEN=true scripts/test.sh