With providers split into bundles, the test injector is now able to
use providers for a given bundle. Suggested provider lists for tests are
available in `angular2/platform/testing/<platform>`.
Change the providers for a test suite using `setBaseTestProviders`. This
should be done once at the start of the test suite, before any test cases
run.
BREAKING CHANGE: Tests are now required to use `setBaseTestProviders`
to set up. Assuming your tests are run on a browser, setup would change
as follows.
Before:
```js
// Somewhere in test setup
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
BrowserDomAdapter.makeCurrent
```
After:
```js
// Somewhere in the test setup
import {setBaseTestProviders} from 'angular2/testing';
import {
TEST_BROWSER_PLATFORM_PROVIDERS,
TEST_BROWSER_APPLICATION_PROVIDERS
} from 'angular2/platform/testing/browser';
setBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS,
TEST_BROWSER_APPLICATION_PROVIDERS);
```
Closes#5351, Closes#5585Closes#5975
BREAKING CHANGE
Before
Previously Angular would run in dev prod mode by default, and you could enable the dev mode by calling enableDevMode.
After
Now, Angular runs in the dev mode by default, and you can enable the prod mode by calling enableProdMode.
move to new RxJS distribution.
BREAKING CHANGE:
RxJS imports now are via `rxjs` instead of `@reactivex/rxjs`
Individual operators can be imported `import 'rxjs/operators/map'`
Currently, core depends on DomRenderer, which depends on the browser.
This means that if you depend on angular2/core, you will always
pull in the browser dom adapter and the browser render, regardless
if you need them or not.
This PR moves the browser dom adapter and the browser renderer out of core.
BREAKING CHANGE
If you import browser adapter or dom renderer directly (not via angular2/core),
you will have to change the import path.
This removes .es6 files which are pure duplicates of a
.ts file in the same folder.
Next we need to remove .js files as well, and remove karma preprocessors for dart.
This is a prerequisite for switching to TypeScript. We need to remove the Traceur preprocessor
from Karma, so we have the build specified in a single place (broccoli tree def'n).
Export files are now directly under the module folder,
e.g. `core/core.js`. With this, an import like `core/core`
won’t need a path mapping (e.g. via `System.paths`) any more.
This adds the `src` folder to all other import statements as well.
modules/angular has no implementation, but depends on all the pieces
that make angular - core, di, directives, etc. It is the package that
all client apps will depend on.
* remove `wraps` syntax enhancements for imports
and support new `import * as module from ...` syntax
- default imports are the wrong construct for importing
everything from a module
* moved tests from transpiler to jasmine and karma
- transpiler tests are included when running karma in main project folder
- transpiler is reloaded after every test run in karma,
so no need to restart karma when the transpiler has been changed.
- removed own gulp build for transpiler and `postinstall.sh`
as they are no more needed.
- transpiler tests are now executed in Dart AND JavaScript (used to be executed
only in Dart), which allowed to catch some bugs (see the bug with the
import specification above).
* made tests work in dart as well by using the following hack:
- dependencies are loaded from the `build` folder, which makes
running `gulp build` necessary before running karma for dart
- for this to work,
the dependencies are included in main `pubspec.yaml` of project
- reason for the hack: `karma-dart` loads all `packages` urls
directly from disc (should rather use the karma file list)
* added explicit annotations `FIELD`, `ABSTRACT`, ... to `facade/lang.*`
- needed for now that we can run tests and don't get errors for undefined
annotations.
* added `README.md` with details about the build and tests
Note: karma with dart is still not working
because of how `karma-dart` loads `package:…` dependencies.
Usage:
```
karma start karma-js.conf.js
karma start karma-dart.conf.js
```
Make sure to set `DARTIUM_BIN` env variable.
Refactors `js2dart`:
- live outside of the traceur module (`tools/js2dart/index.js`)
so it can be reused by gulp and karma
- automatically build the sources in memory,
so that `js2dart` can be used without running `gulp build` first
- provide a way to specify the moduleName of a compilation run
independently of the input filename. This helps error messages
and source maps (not yet enabled) to report the correct file name
Changes project setup:
- add module `test_lib` that contains the primitives for tests
(e.g. `describe`, `it`, …)
- clean up some sources that had errors in them
- module names in transpiled js and dart files don’t contain
`lib`, `test` nor `src` any more (e.g. `di/di`).