angular_test 2.0.0 copy "angular_test: ^2.0.0" to clipboard
angular_test: ^2.0.0 copied to clipboard

discontinuedreplaced by: ngtest
outdated

Testing runner and library for AngularDart

2.0.0 #

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().

1.0.1 #

Cleanup #

  • Remove dependency on angular_router.

1.0.0 #

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

5
likes
0
pub points
69%
popularity

Publisher

verified publisherangulardart.dev

Testing runner and library for AngularDart

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

angular, meta

More

Packages that depend on angular_test