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 · 2 comments
Open

Jasmine types mismatch between vrotest and vropkg #516

Indy-rbo opened this issue Nov 15, 2024 · 2 comments
Labels
area/tests Relates to tests and code coverage kind/bug Something isn't working priority/medium triage/needed Needs to be discussed by project maintainers version/patch The change is a non-breaking bugfix

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

@VenelinBakalov VenelinBakalov added kind/bug Something isn't working version/patch The change is a non-breaking bugfix area/tests Relates to tests and code coverage triage/needed Needs to be discussed by project maintainers priority/medium labels Nov 19, 2024
@Michaelpalacce
Copy link
Collaborator

vropkg has nothing to do with running jasmine tests.

@Indy-rbo
Copy link
Contributor Author

vropkg being an affected component was a guess based on what packages have references to the Jasmine types in this repo and it occurring when using mvn clean package. Sadly still haven't been able to find a good reproducible setup.

But I hope this issue will be resolved as a byproduct of #463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests Relates to tests and code coverage kind/bug Something isn't working priority/medium triage/needed Needs to be discussed by project maintainers version/patch The change is a non-breaking bugfix
Projects
None yet
Development

No branches or pull requests

3 participants