Jasmine/Jest type conflicts

Smrtnyk

I am relatively new here and would need some help. Company I work for uses karma and jasmine for unit testing. Now they would like to migrate some tests to jest. I got a ticket assigned to me. We are using typescript btw... I got jest installed, prefixed with .spec.jest.ts to separate jest test from karmas. And it works fine. Jest just picks up those files that are prefixed. But when i try to do some build things we do with our project I get the type declaration conflicts between jest and jasmine. For example: node_modules/@types/jest/index.d.ts:32:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: beforeAll, beforeEach, afterAll, afterEach, describe, fdescribe, xdescribe, it, fit, xit, expect, clock, DEFAULT_TIMEOUT_INTERVAL, CustomMatcherFact ory, CustomEqualityTester

I am aware that jest is build on top of jasmine but is there some kind of workaround, we want to migrate our tests gradually. One at a time. Is there some kind of workaround to namespace the types for jest or something like that so no conflicts occur?

Tnx in advance for your help :)

I tried to google some workaround but nothing that would solve the issue came across.

Smrtnyk

We excluded the karma types in the tsconfig and added jest types. The IDE now doesn't pick the karma types but it works for us since most of our tests are now in jest and very few left in karma and build process works now correctly since there are no more type conflicts.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Type conflicts with Event Listeners

Custom Post Type Pagenation and URL Conflicts

Avoiding type conflicts with dplyr::case_when

Generic type constraint syntax conflicts with inheritance syntax

How to prevent type conflicts in c#

nth-child conflicts with last-of-type?

SQL Server - Conflicts column type during UNPIVOT

The type of column "Date" conflicts with the type of other columns specified in the UNPIVOT list

The type X in Y conflicts with the imported type X in Z

conflicts when defining DataView after installed @type/vis and vis

"The import [...] conflicts with a type defined in the same file" error [java]

How to deal with type name conflicts in a typescript definition file

"Date" conflicts with the type of other columns specified in the UNPIVOT list SQL server

machine type 'x64' conflicts with target machine type 'X86'

How do I avoid conflicts between haxe Type class and C# Type class?

How to have two structs with same type and name in different header files without conflicts?

use antlr4 to generate go code get symbol type conflicts error

Python module with Fortran: LNK1112 `module machine type 'X86' conflicts with target machine type 'x64'`

Datacontext conflicts

Trying to compile Detours.lib as 32bit on a 64bit machine: LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' running build via vcvarsall.bat x86

Is merge without conflicts equivalent to rebase without conflicts?

resolving conflicts an push reproduce same conflicts again

@ManyToOne conflicts with JpaRepository

Rmarkdown: Datatable conflicts with jquery

Gradle Version conflicts

How to solve conflicts on GitLab?

resolving conflicts in pull request

Conflicts between useEffect in react