Giter Site home page Giter Site logo

Comments (8)

B4nan avatar B4nan commented on September 2, 2024 1

ts-jest detection will land soon hopefully, related PR adding support for detecting ts-jest: kulshekhar/ts-jest#2717

from nestjs.

anlauren avatar anlauren commented on September 2, 2024

Hello! any news on that? from what i'm reading in the module code it would be because this line:

 const key = (preferTsNode && this.config.get('tsNode', Utils_1.Utils.detectTsNode()) && this.config.get('entitiesTs').length > 0) ? 'entitiesTs' : 'entities';

returns "entities" instead of "entitiesTs". Would it come from the fact that jest config says ts-jest
I'm not sure if there's a way around to enforce ts node in a test config, i see the preferTsNode value there 🤔

from nestjs.

B4nan avatar B4nan commented on September 2, 2024

You can control that just by passing tsNode: true to the ORM config - that way the detection is skipped and entitiesTs will be used.

from nestjs.

anlauren avatar anlauren commented on September 2, 2024

Beautiful i'll try this out!

from nestjs.

anlauren avatar anlauren commented on September 2, 2024

Works nicely!
Don't know if it's worth mentioning somewhere in the docs for people using jest in that way 🤔

from nestjs.

B4nan avatar B4nan commented on September 2, 2024

Closing, should work out of box with ts-jest 27.0.4+ and MikroORM v4.5.9+

from nestjs.

xenoterracide avatar xenoterracide commented on September 2, 2024

tried ts-node: true in the latest, though I'm not actually certain that's what we're doing. didn't work, same problem. Feels like a hokey fix though.

from nestjs.

xenoterracide avatar xenoterracide commented on September 2, 2024
❯ yarn why ts-jest
└─ services-core@workspace:.
   └─ ts-jest@npm:27.1.5 [8316d] (via npm:27.1.5 [8316d])
❯ yarn why @mikro-orm/core
└─ services-core@workspace:.
   └─ @mikro-orm/core@npm:5.6.3 [8316d] (via npm:^5.6.3 [8316d])
❯ yarn why jest
├─ jest-cucumber@npm:2.0.12
│  └─ jest@npm:27.5.1 [8875a] (via npm:27.5.1 [8875a])
│
└─ services-core@workspace:.
   └─ jest@npm:27.5.1 [8875a] (via npm:27.5.1 [8875a])

from nestjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.