Skip to content

Commit 5856298

Browse files
alexeaglematsko
authored andcommitted
test: cleanup rxjs custom build
The latest rxjs release works with closure compiler out of the box. We no longer need to compile our own. Also put closure options into a file rather than using a shell script.
1 parent 7f9c589 commit 5856298

11 files changed

Lines changed: 49 additions & 150 deletions

File tree

‎integration/.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/rxjs/
21
built/
32
dist/
43
vendor/

‎integration/README.md‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,7 @@ Angular's `node_modules` is installed.
3232

3333
## Running integration tests
3434

35-
The first time you run the tests, you'll need some setup:
36-
37-
```shell
38-
$ ./integration/build_rxjs_es6.sh
39-
```
40-
41-
Now you can iterate on the tests by keeping the dist folder up-to-date.
35+
You can iterate on the tests by keeping the dist folder up-to-date.
4236
See the `package.json` of the test(s) you're debugging, to see which dist/ folders they install from.
4337
Then run the right `tsc --watch` command to keep those dist folders up-to-date, for example:
4438

‎integration/build_rxjs_es6.sh‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎integration/hello_world__closure/bundle.sh‎

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--compilation_level=ADVANCED_OPTIMIZATIONS
2+
--language_out=ES5
3+
--js_output_file=dist/bundle.js
4+
--output_manifest=dist/manifest.MF
5+
--variable_renaming_report=dist/variable_renaming_report
6+
--property_renaming_report=dist/property_renaming_report
7+
--create_source_map=%outname%.map
8+
9+
--warning_level=QUIET
10+
--dependency_mode=STRICT
11+
--rewrite_polyfills=false
12+
13+
node_modules/zone.js/dist/zone_externs.js
14+
15+
--js node_modules/rxjs/**.js
16+
--process_common_js_modules
17+
--module_resolution=node
18+
19+
node_modules/@angular/core/@angular/core.js
20+
--js_module_root=node_modules/@angular/core
21+
node_modules/@angular/core/src/testability/testability.externs.js
22+
23+
node_modules/@angular/common/@angular/common.js
24+
--js_module_root=node_modules/@angular/common
25+
26+
node_modules/@angular/platform-browser/@angular/platform-browser.js
27+
--js_module_root=node_modules/@angular/platform-browser
28+
29+
--js built/**.js
30+
--entry_point=built/src/main
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"open": false,
3-
"logLevel": "silent",
3+
"logLevel": "silent",
44
"port": 8080,
55
"server": {
66
"baseDir": "src",
77
"routes": {
8-
"/dist": "dist"
8+
"/dist": "dist",
9+
"/node_modules": "node_modules"
910
},
1011
"middleware": {
1112
"0": null
1213
}
1314
}
14-
}
15+
}

‎integration/hello_world__closure/package.json‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
1212
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
1313
"@angular/tsc-wrapped": "file:../../dist/tools/@angular/tsc-wrapped",
14-
"google-closure-compiler": "20161201.0.0",
15-
"rxjs": "file:../../node_modules/rxjs",
14+
"google-closure-compiler": "20170409.0.0",
15+
"rxjs": "5.3.1",
1616
"typescript": "2.1.6",
17-
"zone.js": "0.7.6"
17+
"zone.js": "0.8.6"
1818
},
1919
"devDependencies": {
2020
"@types/jasmine": "2.5.41",
@@ -23,9 +23,10 @@
2323
"protractor": "file:../../node_modules/protractor"
2424
},
2525
"scripts": {
26-
"test": "ngc && ./bundle.sh && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first",
26+
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
27+
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first",
2728
"serve": "lite-server -c e2e/browser.config.json",
2829
"preprotractor": "tsc -p e2e",
2930
"protractor": "protractor e2e/protractor.config.js"
3031
}
31-
}
32+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<!doctype html>
22
<html>
3+
34
<head>
45
<meta charset="utf-8">
56
<title>Hello World</title>
67
<base href="/">
78
</head>
9+
810
<body>
9-
<hello-world-app>Loading...</hello-world-app>
11+
<hello-world-app>Loading...</hello-world-app>
1012

11-
<script src="dist/bundle.js"></script>
13+
<script src="node_modules/zone.js/dist/zone.min.js"></script>
14+
<script src="dist/bundle.js"></script>
1215

1316
</body>
14-
</html>
17+
18+
</html>

‎integration/run_tests.sh‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ set -e -o pipefail
44

55
cd `dirname $0`
66

7-
if [ ! -d "rxjs/dist/es6" ]; then
8-
echo "You must run build the ES2015 version of RxJS for some tests:"
9-
echo "./integration/build_rxjs_es6.sh"
10-
exit 1
11-
fi
12-
137
# Workaround https://github.com/yarnpkg/yarn/issues/2165
148
# Yarn will cache file://dist URIs and not update Angular code
159
readonly cache=.yarn_local_cache
@@ -20,7 +14,7 @@ rm_cache
2014
mkdir $cache
2115
trap rm_cache EXIT
2216

23-
for testDir in $(ls | grep -v rxjs | grep -v node_modules) ; do
17+
for testDir in $(ls | grep -v node_modules) ; do
2418
[[ -d "$testDir" ]] || continue
2519
echo "#################################"
2620
echo "Running integration test $testDir"

‎integration/rxjs.tsconfig.json‎

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)