DEV Community

Cover image for Spectacular prerelease v0.4 reintroduces the required pipeName option for pipe harnesses

Spectacular prerelease v0.4 reintroduces the required pipeName option for pipe harnesses

Cover art by DALL-E.

In July 2022, we published the version 0.4.0 prerelease of Spectacular, the integration testing library for Angular.

Note that for prerelase versions, that is versions <1.0.0, minor version increases indicate breaking changes, for example releasing version 0.4.0 introduces at least one breaking change compared to version 0.3.0. Patch version increases for prerelease versions indicate bugfixes, refactors, performance improvements, and/or feature additions.

Let's discuss the breaking changes between prerelease versions 0.2.0-0.4.0.

The pipeName option for pipe harnesses is reintroduced

Back in Spectacular prerelease version 0.3.0, released in May 2022, we removed the pipeName option from the createPipeHarness factory to make Angular pipe testing easier. This was a breaking change as the pipeName option was removed entirely in version 0.3.0.

Unfortunately, a function we used internally for determining the pipe name was removed from Angular as it was a leftover from Angular View Engine.

Because of this, Spectacular version 0.4.0 introduces the breaking change of adding back the required pipeName option for createPipeHarness.

Spectacular version 0.3.0:

const harness = createPipeHarness({
  pipe: PowPipe,
  value: 2,
});
Enter fullscreen mode Exit fullscreen mode

Spectacular versions <0.3.0 >=0.4.0:

const harness = createPipeHarness({
  pipe: PowPipe,
  pipeName: 'pow',
  value: 2,
});
Enter fullscreen mode Exit fullscreen mode

Read the documentation for Spectacular's Pipe testing API for full examples of Angular pipe integration tests.

Oldest comments (0)