Skip to content

Commit 9229088

Browse files
gkalpakjasonaden
authored andcommitted
test: minor improvements in examples e2e tests script (angular#18487) (angular#18487)
PR Close angular#18487 PR Close angular#18487
1 parent 8dec381 commit 9229088

File tree

2 files changed

+47
-36
lines changed

2 files changed

+47
-36
lines changed

packages/examples/build.sh

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,36 @@ set -u -e -o pipefail
99
# can be used to run each of the examples in isolation via http as well.
1010
#
1111

12-
cd `dirname $0`
13-
14-
DIST="../../dist/examples";
15-
rm -rf -- $DIST
16-
$(npm bin)/tsc -p ./tsconfig-build.json --importHelpers false
17-
18-
mkdir $DIST/vendor/
19-
20-
ln -s ../../../dist/packages-dist/ $DIST/vendor/@angular
21-
22-
for FILE in \
23-
../../../node_modules/angular/angular.js \
24-
../../../node_modules/zone.js/dist/zone.js \
25-
../../../node_modules/zone.js/dist/task-tracking.js \
26-
../../../node_modules/systemjs/dist/system.js \
27-
../../../node_modules/reflect-metadata/Reflect.js \
28-
../../../node_modules/rxjs
29-
do
30-
ln -s $FILE $DIST/vendor/`basename $FILE`
31-
done
32-
33-
for MODULE in `find . -name module.ts`; do
34-
FINAL_DIR_PATH=$DIST/`dirname $MODULE`
35-
36-
echo "==== $MODULE"
37-
cp _common/*.html $FINAL_DIR_PATH
38-
cp $DIST/_common/*.js $FINAL_DIR_PATH
39-
cp $DIST/_common/*.js.map $FINAL_DIR_PATH
40-
41-
find `dirname $MODULE` -name \*.css -exec cp {} $FINAL_DIR_PATH \;
42-
done
12+
(
13+
cd `dirname $0`
14+
15+
DIST="../../dist/examples";
16+
rm -rf -- $DIST
17+
$(npm bin)/tsc -p ./tsconfig-build.json --importHelpers false
18+
19+
mkdir $DIST/vendor/
20+
21+
ln -s ../../../dist/packages-dist/ $DIST/vendor/@angular
22+
23+
for FILE in \
24+
../../../node_modules/angular/angular.js \
25+
../../../node_modules/zone.js/dist/zone.js \
26+
../../../node_modules/zone.js/dist/task-tracking.js \
27+
../../../node_modules/systemjs/dist/system.js \
28+
../../../node_modules/reflect-metadata/Reflect.js \
29+
../../../node_modules/rxjs
30+
do
31+
ln -s $FILE $DIST/vendor/`basename $FILE`
32+
done
33+
34+
for MODULE in `find . -name module.ts`; do
35+
FINAL_DIR_PATH=$DIST/`dirname $MODULE`
36+
37+
echo "==== $MODULE"
38+
cp _common/*.html $FINAL_DIR_PATH
39+
cp $DIST/_common/*.js $FINAL_DIR_PATH
40+
cp $DIST/_common/*.js.map $FINAL_DIR_PATH
41+
42+
find `dirname $MODULE` -name \*.css -exec cp {} $FINAL_DIR_PATH \;
43+
done
44+
)

packages/examples/test.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

3-
cd `dirname $0`
4-
./build.sh
3+
set -u -e -o pipefail
54

6-
gulp serve-examples &
5+
(
6+
cd `dirname $0`
7+
./build.sh
78

8-
(cd ../../ && NODE_PATH=$NODE_PATH:dist/all $(npm bin)/protractor protractor-examples-e2e.conf.js --bundles=true)
9+
gulp serve-examples &
10+
trap "kill $!" EXIT
11+
12+
(
13+
cd ../../
14+
NODE_PATH=${NODE_PATH:-}:dist/all
15+
$(npm bin)/protractor protractor-examples-e2e.conf.js --bundles=true
16+
)
17+
)

0 commit comments

Comments
 (0)