Versions
@artstesh/it-should is published in two major lines maintained in parallel. The major version encodes the TypeScript generation the line targets; this documentation describes the v2 line.
Line | TypeScript peer | Latest | Branch |
|---|---|---|---|
2.x |
| 2.2.0 |
|
1.x |
| 1.3.0 |
|
Features and fixes flow from v2 to v1 by porting — behavior described here applies to both lines unless a difference is called out. Since 2.1.0 the v2 line supports both TypeScript 5 and TypeScript 6 projects (the peer range excludes TypeScript 7, the Go-based compiler, until it is verified).
Changelog
2.x — the TypeScript 5/6 line
2.2.0 — the method verifier goes public:
should().method(fn).throws(...args)andreturns(...args), which hands the produced value back for further chains (Methods).2.1.0 — TypeScript 6 support: the peer range widens to
>=5.0.2 <7. No API changes; existing TypeScript 5 consumers are unaffected.2.0.0 — the
^5.0.2TypeScript peer line;should().objects()and the internal object manager are constrained to object types ({}) for stricter typing of the two compared sides.2.0.1 / 2.0.2 — maintenance releases.
1.x — the TypeScript 4 line
1.3.0 — the method verifier ships:
method()withthrows(...args)andreturns(...args)(the v1 port of the v2 2.2.0 change; see Methods).1.2.0 / 1.2.1 — internal groundwork for method verification (not yet part of the public API); maintenance fixes.
1.1.6 —
should().false(0)correctly passes (0 is falsy).1.1.5 —
equalUnorderedfor arrays.1.1.4 —
equalfor arrays,matchfor strings.1.1.3 —
uniqfor arrays.1.1.2 —
should().true()/should().false().1.1.0 — date verifications:
before,after,equalswith accuracy.1.0.2 — the
containfamily:contain,containBy,containExactly,containByExactly,containOnly.1.0.1 —
map()for object comparison; initial public line.
Upgrading 1.x → 2.x
For consumers the API surface is the same chains; the difference is the TypeScript peer and stricter generics on objects() — code comparing non-object values (primitives) through should().objects(...) no longer compiles, by design. Install the line matching your TypeScript version (see Installation).