Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(testing): remove wrapping of Jasmine functions #9564

Merged
merged 1 commit into from Jun 25, 2016

Commits on Jun 25, 2016

  1. refactor(testing): remove wrapping of Jasmine functions

    Instead, the async function now determines whether it should return a promise
    or instead call a done function parameter. Importing Jasmine functions
    from `@angular/core/testing` is no longer necessary and is now deprecated.
    
    Additionally, beforeEachProviders is also deprecated, as it is specific
    to the testing framework. Instead, use the new addProviders method directly.
    
    Before:
    ```js
    import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';
    
    describe('my code', () => {
      beforeEachProviders(() => [MyService]);
    
      it('does stuff', inject([MyService], (service) => {
        // actual test
      });
    });
    ```
    
    After:
    ```js
    import {addProviders, inject} from 'angular2/testing/core';
    
    describe('my code', () => {
      beforeEach(() => {
        addProviders([MyService]);
      });
    
      it('does stuff', inject([MyService], (service) => {
        // actual test
      });
    });
    ```
    juliemr committed Jun 25, 2016
    Configuration menu
    Copy the full SHA
    033f1fd View commit details
    Browse the repository at this point in the history