Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jasmine types mismatch between vrotest and vropkg #516

Open
Indy-rbo opened this issue Nov 15, 2024 · 0 comments
Open

Jasmine types mismatch between vrotest and vropkg #516

Indy-rbo opened this issue Nov 15, 2024 · 0 comments

Comments

@Indy-rbo
Copy link
Contributor

Description

The package @types/jasmine (and jasmine itself) have a version mismatch between vropkg and vrotest.
While the jasmine package itself did not give me issues, the @types/jasmine does.

The following example should work, type wise.
It will work inside the editor and (most of the time) when running mvn clean package:

let mySpy: jasmine.SpyObj<MyService>;
beforeAll(() => {
  mySpy = spyOnAllFunctions(MyService.prototype)
})

But sometimes it generates the error:

error Type 'Spy' is not assignable to type 'SpyObj<MyService>'.

As you can see in the links below, when you search for spyOnAllFunctions the definitions don't match

3.3.9: https://www.npmjs.com/package/@types/jasmine/v/3.3.9?activeTab=code

declare function spyOnAllFunctions(object: object): jasmine.Spy;

3.10.3: https://www.npmjs.com/package/@types/jasmine/v/3.10.3?activeTab=code

declare function spyOnAllFunctions<T>(object: T, includeNonEnumerable?: boolean): jasmine.SpyObj<T>;

Steps to Reproduce

  1. Create a test where you assign a variable that is defined as jasmine.SpyObj<MyService> with something from spyOnAllFunctions
  2. Run mvn clean package
  3. It sometimes(?) errors

Preconditions: Unsure

Expected behavior: To have it use the correct type definitions

Actual behavior: It (sometimes) uses the old type definitions, which then errors during type checking

Reproduces how often: Unsure, but haven't found a case where it reproduces 100%

Component/s: typescript/vrotest, typescript/vropkg

Affects Build/s: Up to 2.44.0

Related issues and PRs

#463
#332

Additional Context

Unsure if the jasmine package itself should also be upgraded, since vropkg uses ^3.3.1 and vrotest uses 4.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant