Spectacular prerelease v0.4 reintroduces the required pipeName option for pipe harnesses
Lars Gyrup Brink Nielsen

Lars Gyrup Brink Nielsen @layzee

About: 👨‍🏫 Co-Founder of This is Learning, Organizer of AarhusJS ✍️ Writer, Speaker, FOSS Maintainer 📗 Author 🏆 Microsoft MVP 🌟 GitHub Star 🌊 Nx Champion 🦸 Angular Hero of Education

Location:
Holstebro, Denmark
Joined:
Aug 7, 2018

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

Publish Date: Aug 10 '22
6 0

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.

Comments 0 total

    Add comment