You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Current behavior
The TypeScript compiler throws a TypeError when one is testing a service that uses the CacheBucket.
Which causes the following in a Spectator driven test that is executed by Jest (we do not use the createHttpFactory here since we explicitly want to validate the cache context):
TypeError: Constructor Set requires 'new'
at CacheBucket.Set (<anonymous>)
Since CacheBucket only extends Set without applying anything else, it is possible to fix this issue by typing the CacheBucket as Set here, but this is dangerous since the implementation may change over time.
Expected behavior
We should fix this, so we have a happy compiler.
Minimal reproduction of the problem with instructions
Angular >= 12 with TypeScript 4.3.5 and Cashew 2.3.2.
What is the motivation / use case for changing the behavior?
Environment
Angular version: 12.2.16
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
The text was updated successfully, but these errors were encountered:
What about the following? It's not ideal but does the trick I think.
Adding another expect expect(service.bucket).toBeInstanceOf(Set); will still assert the type of the bucket to ensure the implementation did not change, making it less dangerous to use as Set or service.bucket directly.
I'm submitting a...
Current behavior
The TypeScript compiler throws a TypeError when one is testing a service that uses the CacheBucket.
Example service:
Which causes the following in a Spectator driven test that is executed by Jest (we do not use the createHttpFactory here since we explicitly want to validate the cache context):
Since CacheBucket only extends Set without applying anything else, it is possible to fix this issue by typing the CacheBucket as Set here, but this is dangerous since the implementation may change over time.
Expected behavior
We should fix this, so we have a happy compiler.
Minimal reproduction of the problem with instructions
Angular >= 12 with TypeScript 4.3.5 and Cashew 2.3.2.
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: