chore: add browserNoRouter test running mode
This commit is contained in:
parent
c977a906b3
commit
8c8754e573
|
@ -101,11 +101,12 @@ To build Angular run:
|
||||||
To run tests:
|
To run tests:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ ./test.sh node
|
$ ./test.sh node # Run all angular tests on node
|
||||||
|
|
||||||
$ ./test.sh browser
|
$ ./test.sh browser # Run all angular tests in browser
|
||||||
|
$ ./test.sh browserNoRouter # Optionally run all angular tests without router in browser
|
||||||
|
|
||||||
$ ./test.sh tools
|
$ ./test.sh tools # Run angular tooling (not framework) tests
|
||||||
```
|
```
|
||||||
|
|
||||||
You should execute the 3 test suites before submitting a PR to github.
|
You should execute the 3 test suites before submitting a PR to github.
|
||||||
|
|
|
@ -13,14 +13,11 @@ import {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
||||||
import {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';
|
import {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';
|
||||||
import {OptionalMetadata, SkipSelfMetadata} from './di';
|
import {OptionalMetadata, SkipSelfMetadata} from './di';
|
||||||
import {Compiler} from './linker/compiler';
|
import {Compiler} from './linker/compiler';
|
||||||
import {ComponentFactoryResolver} from './linker/component_factory_resolver';
|
|
||||||
import {ComponentResolver} from './linker/component_resolver';
|
import {ComponentResolver} from './linker/component_resolver';
|
||||||
import {DynamicComponentLoader, DynamicComponentLoader_} from './linker/dynamic_component_loader';
|
import {DynamicComponentLoader, DynamicComponentLoader_} from './linker/dynamic_component_loader';
|
||||||
import {ViewUtils} from './linker/view_utils';
|
import {ViewUtils} from './linker/view_utils';
|
||||||
import {NgModule} from './metadata';
|
import {NgModule} from './metadata';
|
||||||
|
|
||||||
let __unused: Type; // avoid unused import when Type union types are erased
|
|
||||||
|
|
||||||
export function _iterableDiffersFactory() {
|
export function _iterableDiffersFactory() {
|
||||||
return defaultIterableDiffers;
|
return defaultIterableDiffers;
|
||||||
}
|
}
|
||||||
|
|
2
test.sh
2
test.sh
|
@ -6,7 +6,7 @@ if [ $# -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "Angular test runner. (No platform specified)"
|
echo "Angular test runner. (No platform specified)"
|
||||||
echo
|
echo
|
||||||
echo "./test.sh [node|browser|tools]"
|
echo "./test.sh [node|browser|browserNoRouter|tools]"
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
cd `dirname $0`
|
cd `dirname $0`
|
||||||
|
|
|
@ -58,13 +58,15 @@ function md(dir: string, folders: string[]) {
|
||||||
var tscWatch: TscWatch = null;
|
var tscWatch: TscWatch = null;
|
||||||
var platform = process.argv.length >= 3 ? process.argv[2] : null;
|
var platform = process.argv.length >= 3 ? process.argv[2] : null;
|
||||||
var runMode: string = process.argv.length >= 4 ? process.argv[3] : null;
|
var runMode: string = process.argv.length >= 4 ? process.argv[3] : null;
|
||||||
|
const BaseConfig = {
|
||||||
|
start: 'File change detected. Starting incremental compilation...',
|
||||||
|
error: 'error',
|
||||||
|
complete: 'Compilation complete. Watching for file changes.'
|
||||||
|
};
|
||||||
|
|
||||||
if (platform == 'node') {
|
if (platform == 'node') {
|
||||||
tscWatch = new TscWatch({
|
tscWatch = new TscWatch(Object.assign({
|
||||||
tsconfig: 'modules/tsconfig.json',
|
tsconfig: 'modules/tsconfig.json',
|
||||||
start: 'File change detected. Starting incremental compilation...',
|
|
||||||
error: 'error',
|
|
||||||
complete: 'Compilation complete. Watching for file changes.',
|
|
||||||
onChangeCmds: [
|
onChangeCmds: [
|
||||||
processOutputEmitterCodeGen,
|
processOutputEmitterCodeGen,
|
||||||
[
|
[
|
||||||
|
@ -72,13 +74,10 @@ if (platform == 'node') {
|
||||||
'@angular/compiler-cli/test/**/*_spec.js'
|
'@angular/compiler-cli/test/**/*_spec.js'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
}, BaseConfig));
|
||||||
} else if (platform == 'browser') {
|
} else if (platform == 'browser') {
|
||||||
tscWatch = new TscWatch({
|
tscWatch = new TscWatch(Object.assign({
|
||||||
tsconfig: 'modules/tsconfig.json',
|
tsconfig: 'modules/tsconfig.json',
|
||||||
start: 'File change detected. Starting incremental compilation...',
|
|
||||||
error: 'error',
|
|
||||||
complete: 'Compilation complete. Watching for file changes.',
|
|
||||||
onStartCmds: [
|
onStartCmds: [
|
||||||
[
|
[
|
||||||
'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9876',
|
'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9876',
|
||||||
|
@ -93,17 +92,27 @@ if (platform == 'node') {
|
||||||
['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js', '--port=9876'],
|
['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js', '--port=9876'],
|
||||||
['node', 'node_modules/karma/bin/karma', 'run', '--port=9877'],
|
['node', 'node_modules/karma/bin/karma', 'run', '--port=9877'],
|
||||||
]
|
]
|
||||||
});
|
}, BaseConfig));
|
||||||
|
} else if (platform == 'browserNoRouter') {
|
||||||
|
tscWatch = new TscWatch(Object.assign({
|
||||||
|
tsconfig: 'modules/tsconfig.json',
|
||||||
|
onStartCmds: [
|
||||||
|
[
|
||||||
|
'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9876',
|
||||||
|
'karma-js.conf.js'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
onChangeCmds: [
|
||||||
|
['node', 'node_modules/karma/bin/karma', 'run', 'karma-js.conf.js', '--port=9876'],
|
||||||
|
]
|
||||||
|
}, BaseConfig));
|
||||||
} else if (platform == 'tools') {
|
} else if (platform == 'tools') {
|
||||||
tscWatch = new TscWatch({
|
tscWatch = new TscWatch(Object.assign({
|
||||||
tsconfig: 'tools/tsconfig.json',
|
tsconfig: 'tools/tsconfig.json',
|
||||||
start: 'File change detected. Starting incremental compilation...',
|
|
||||||
error: 'error',
|
|
||||||
complete: 'Compilation complete. Watching for file changes.',
|
|
||||||
onChangeCmds: [[
|
onChangeCmds: [[
|
||||||
'node', 'dist/tools/cjs-jasmine/index-tools', '--', '@angular/tsc-wrapped/**/*{_,.}spec.js'
|
'node', 'dist/tools/cjs-jasmine/index-tools', '--', '@angular/tsc-wrapped/**/*{_,.}spec.js'
|
||||||
]]
|
]]
|
||||||
});
|
}, BaseConfig));
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`unknown platform: ${platform}`);
|
throw new Error(`unknown platform: ${platform}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue