PackageTrack
Sign in Get early access

angular_test

Testing runner and library for AngularDart

4.0.1 angulardart/angular

What this package is like to depend on

Last release 5 years ago

no release in 18 months

Ships unpredictably

gaps range from 2 weeks to 1.2 years

Nearly every release is documented

notes for 11 of 11 stable releases

Nothing withdrawn

no release was ever pulled

10 years old

39 releases · first in 2017

0 releases in the last 12 months

see the full history below

Release timeline

39 releases · Feb 2017 to Oct 2021
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 39
  1. 4.0.1 07 Oct 2021
    Release notes
    • Update README.md
    Open source →
  2. 4.0.0 17 Sep 2021
    Release notes
    • Support null safety
    • Require Dart ^2.14.0
    Open source →
  3. 3.0.0 08 Oct 2020
    Release notes

    New Features

    • NgTestFixture.dispose() now resets and clears all component styles from the DOM when assertions are enabled.

    Breaking Changes

    • NgTestBed (the default constructor) is now identical to the behavior of NgTestBed.forComponent and has replaced it, and the original implementation that used initReflector() to load classes based on Type has been renamed to NgTestBed.useInitReflector.

    Bug Fixes

    • Removed _alwaysStable when other stabilizers exist.
    Open source →
  4. 2.4.0 25 Jul 2019
    Release notes

    New Features

    • Added an optional named parameter, maxIterations, to FakeTimeNgZoneStabilizer's constructor. If not specified 10 maximum loops are attempted to elapse pending timers. In advanced use cases, a test may configure a higher threshold:

      NgZoneStabilizer allow100InsteadOf10() {
        return FakeTimeNgZoneStabilizer(timerZone, ngZone, maxIterations: 100);
      }
      

    Bug Fixes

    • NgTestFixture.update() now delegates to ComponentRef.update(), which automatically calls markForCheck(). Previously, an OnPush component under test might not have been properly updated.
    Open source →
  5. 2.3.1 23 May 2019
    Release notes
    • Maintenance release to support Angular 6.0-alpha.
    Open source →
  6. 2.3.0 05 Apr 2019
    Release notes

    New Features

    • Added support for periodic timers in FakeTimeNgZoneStabilizer.
    Open source →
  7. 2.2.0 10 Dec 2018
    Release notes

    Breaking Changes

    • Changed NgTestStabilizer initialization from originating from a List<NgTestStabilizerFactory> to a single NgTestStabilizerFactory. The new top-level function composeStabilizers may be used to create a composite factory from multiple factories:

      composeStabilizers([
        (_) => stabilizer1,
        (_) => stabilizer2,
      ])
      

      This helps disambiguate the order of stabilizers running, which in turn will allow additional new stabilizers and features to be added in a non-breaking fashion. This change does not impact users that were not augmenting or creating their own stabilizers (i.e. most users/most tests).

    • Removed NgTestStabilizer.all. See composeStabilizers instead.

    • Removed NgZoneStabilizer. The new class is RealTimeNgZoneStabilizer, though most users should not be impacted NgTestBed now uses the new stabilizer by default.

    New Features

    • Added a new NgTestStabilizer.alwaysStable, which does what it sounds like and always reports stability. This handles making composition easier as the root stabilizer can effectively be a no-op.

    Bug Fixes

    • When using RealTimeNgZoneStabilizer, do not try to stabilize timers that run outside of Angular zone.
    Open source →
  8. 2.1.0 10 Oct 2018
    Release notes

    New Features

    • Supported beforeComponentCreated(Injector) when creating fixture to allow using injector to set up prerequisite data for testing from DI.

      This is useful when an object (that is already injected to the app) is difficult to create otherwise. For example:

      // ComplexDataLayer is difficult to instantiate in test, but it is needed
      // to set up some fake data before the component is loaded and used.
      final fixture = await testBed.create(
        beforeComponentCreated: (i) {
          var dataLayer = i.get(ComplexDataLayer) as ComplexDataLayer;
          dataLayer.setUpMockDataForTesting();
        },
      );
      
    Open source →
  9. 2.0.0 07 Aug 2018
    Release notes

    New Features

    • Supported FutureOr<void> for beforeChangeDetection.

    • NgZoneStabilizer waits for the longest pending timer during update().

    • Added isStable API to NgTestStabilizer.

    • Made NgTestStabilizerFactory public.

    Breaking Changes

    • Removed throwsInAngular. Use throwsA.

    • Removed NgTestFixture#query/queryAll, as debug-mode is being turned down.

    • Run DelegatingNgTestStabilizer stabilizers one by one instead of run all at once. update() for each stabilizers will be run at least once. After that, it will only be run if the current stabilizer is not stable.

    • pub run angular_test was entirely removed. Similar functionality is supported out of the box by build_runner:

    $ pub run build_runner test
    
    • Removed built-in support for package:pageloader. The current version of pageloader relies on dart:mirrors, which is being removed from the web compilers (dart2js, dartdevc). There is a new version of pageloader in development that uses code generation. We'll consider re-adding support once available or through another package (i.e. angular_pageloader or similar).

    • Adding stabilizers to NgTestBed now takes a factory function of type NgTestStabilizer Function(Injector), which is aliased as NgTestStabilizerFactory. This allows using NgTestBed without any dynamic reflective factories (i.e. initReflector()) and doesn't have impact to most users.

    Bug Fixes

    • Deleted an unnecessary hostElement.append(componentRef.location).

    • Fixed a bug where a WillNeverStabilizeError was thrown whenever there was a non-zero length Timer being executed. This was due to a bug in how the NgStabilizer was executing - constantly calling the update function instead of calling it once and waiting for stabilization.

    • Fixed a bug where stabilizers are considered stable even when some of them are not.

    • Fixed a bug where _createDynamic does not preserve rootInjector.

    • Added NgTestBed.forComponent, which takes a ComponentFactory<T>, and optionally an InjectorFactory. This allows writing tests entirely free of any invocations of initReflector().

    Open source →
  10. 2.0.0-beta 29 Jun 2018 pre-release

    Nothing published for this version

  11. 2.0.0-beta+1 16 Jul 2018 pre-release

    Nothing published for this version

  12. 2.0.0-beta+2 19 Jul 2018 pre-release

    Nothing published for this version

  13. 2.0.0-beta+3 02 Aug 2018 pre-release

    Nothing published for this version

  14. 2.0.0-alpha 19 Dec 2017 pre-release

    Nothing published for this version

  15. 2.0.0-alpha+1 08 Jan 2018 pre-release

    Nothing published for this version

  16. 2.0.0-alpha+2 18 Jan 2018 pre-release

    Nothing published for this version

  17. 2.0.0-alpha+3 06 Feb 2018 pre-release

    Nothing published for this version

  18. 2.0.0-alpha+4 27 Feb 2018 pre-release

    Nothing published for this version

  19. 2.0.0-alpha+5 07 Mar 2018 pre-release

    Nothing published for this version

  20. 2.0.0-alpha+6 16 Mar 2018 pre-release

    Nothing published for this version

  21. 2.0.0-alpha+7 29 Mar 2018 pre-release

    Nothing published for this version

  22. 2.0.0-alpha+8 10 Apr 2018 pre-release

    Nothing published for this version

  23. 2.0.0-alpha+9 23 Apr 2018 pre-release

    Nothing published for this version

  24. 2.0.0-alpha+10 17 May 2018 pre-release

    Nothing published for this version

  25. 2.0.0-alpha+11 24 May 2018 pre-release

    Nothing published for this version

  26. 2.0.0-alpha+12 05 Jun 2018 pre-release

    Nothing published for this version

  27. 2.0.0-alpha+13 15 Jun 2018 pre-release

    Nothing published for this version

  28. 1.0.2-alpha 10 Oct 2017 pre-release

    Nothing published for this version

  29. 1.0.2-alpha+1 21 Nov 2017 pre-release

    Nothing published for this version

  30. 1.0.1 25 Sep 2017
    Release notes

    Cleanup

    • Remove dependency on angular_router.
    Open source →
  31. 1.0.0 30 Aug 2017
    Release notes

    Breaking Changes & Deprecations

    • Throws in bootstrapping if the root component does not use default change detection. AngularDart does not support OnPush or other change detection strategies on the root component.

    • Pub serve now defaults to a random unused port (instead of 8080) and --port is deprecated. Going forward the supported way to supply this argument is via --serve-arg:

    $ pub run angular_test --serve-arg=port=1234
    
    • Option --run-test-flag (-t) is now deprecated, and no longer has a default value of aot. Tags are still highly encouraged in order to have faster compilation times! Use --test-arg instead:
    $ pub run angular_test --test-arg=--tags=aot
    
    • Option --platform (-p) is now Deprecated, and no longer has a default value of content-shell, which was not always installed on host machines. Instead use --test-arg:
    $ pub run angular_test --test-arg=--platform=content-shell
    
    • Option --name (-n) and --simple-name (-N) are also deprecated. Use --test-arg=--name= and --test-arg=--simple-name= instead.

    • Changes to compatibility.dart might not be considered in future semver updates, and it highly suggested you don't use these APIs for any new code.

    • Change NgTestFixture.update to have a single optional parameter

    Features

    • Add assertOnlyInstance to fixture to remove some boilerplate around testing the state of a instance. Only use to test state, not to update it.

    • Added --serve-arg and --test-arg, which both support multiple arguments in order to have better long-term support for proxying to both pub serve and pub run test without frequent changes to this package. For example to use the [DartDevCompiler (dartdevc)]:

    $ pub run angular_test --serve-arg=web-compiler=dartdevc
    
    • Add support for setting a custom PageLoader factory:
    testBed = testBed.setPageLoader(
      (element) => new CustomPageLoader(...),
    );
    
    • Add support for query and queryAll to NgTestFixture. This works similar to the update command, but is called back with either a single or multiple child component instances to interact with or run expectations against:
    // Assert we have 3 instances of <child>.
    await fixture.queryAll(
      (el) => el.componentInstance is ChildComponent,
      (children) {
        expect(children, hasLength(3));
      },
    );
    
    • Add built-in support for package:pageloader:
    final fixture = await new NgTestBed<TestComponent>().create();
    final pageObject = await fixture.getPageObject/*<ClickCounterPO>*/(
      ClickCounterPO,
    );
    expect(await pageObject.button.visibleText, 'Click count: 0');
    await pageObject.button.click();
    expect(await pageObject.button.visibleText, 'Click count: 1');
    

    Fixes

    • Workaround for pub {serve|build} hanging on angular_test as a dependency.

    • Fixes a bug where the root was not removed from the DOM after disposed.

    • Added a missing dependency on package:func.

    • Properly fix support for windows by using pub.bat.

    • Replace all uses of generic comment with proper syntax.

    • Fixed a bug where activeTest was never set (and therefore disposed).

    • Fixed a bug where pub, not pub.bat, is run in windows.

    • Update pubspec.yaml so it properly lists AngularDart 3.0.0-alpha

    • Fix the executable so pub run angular_test can be used

    • Fix a serious generic type error when NgTestBed is forked

    • Fix a generic type error

    • Added compatibility.dart, a temporary API to some users migrate

    Open source →
  32. 1.0.0-beta 29 Mar 2017 pre-release

    Nothing published for this version

  33. 1.0.0-beta+1 30 Mar 2017 pre-release

    Nothing published for this version

  34. 1.0.0-beta+2 04 Apr 2017 pre-release

    Nothing published for this version

  35. 1.0.0-beta+3 16 Jun 2017 pre-release

    Nothing published for this version

  36. 1.0.0-beta+4 11 Jul 2017 pre-release

    Nothing published for this version

  37. 1.0.0-beta+5 07 Aug 2017 pre-release

    Nothing published for this version

  38. 1.0.0-alpha+5 07 Feb 2017 pre-release

    Nothing published for this version

  39. 1.0.0-alpha+6 17 Mar 2017 pre-release

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive