Intermezzo – NestJS + Jest vs Angular + Jasmine
BingoBingo is a small project, written in TypeScript , and developed with Alexandru Badita in launch break (one hour - more or less). You can find sources at https://github.com/alexandru360/PresentationBingoCards/ . Those are my blog posts for Bingo : ( scroll below for the post)
We decided to add an Angular project. As a immediate consequence , the compile ( tsc ) of the API ( bingo-cards-api) it failes with the first error being:
../node_modules/@types/jasmine/ts3.1/index.d.ts:16: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, DEFAULT_TIMEOUT_INTERVAL, CustomMatcherFactory, CustomEqualityTester
Obviously, we have a conflict… And the conflict is done by Angular( that comes with Jasmine by default) and Nest ( that comes with Jest) ( and us, that we have choose Jest)
There are 3 solving paths:
- Convert all to Jasmine
- Convert all to Jest
- Eliminate the tests from the Angular , eliminate the tests from Nest and create the own library to test (we have done already this, in bingo-meeting-objects-test)
Solution 1 : means re-factor all. Not good.
I have tried the 2 , but , in spite of many tutorials on the internet, some problems have arrived.
So we have the 3 : eliminate all references to Jest and Jasmine, with the exception of bingo-meeting-objects-test
And… it worked!
Leave a Reply