Coder Social home page Coder Social logo

Comments (3)

elliotsayes avatar elliotsayes commented on May 9, 2024 4

@danwt
tsconfig.json:

{
  "compilerOptions": {
    ...
    "esModuleInterop": true,
    ...
  }
}

Fixes most of the annoying BS for me.

@jsynowiec Really not sure why this isn't the default. No one wants to waste time reading 100 pages of documentation to understand what is going on...

from node-typescript-boilerplate.

jsynowiec avatar jsynowiec commented on May 9, 2024 1

Please read this first. If you have problems with Jest, check the Jest and the ts-jest transformer docs. Also, you can check out one of the earlier tags if you do not want ESM and keep using CommonJS instead.

Regarding chalk, please read their v5 release notes - it mentions that you should probably stay on v4 in this case.

The following code works fine when added to the unit test and use chalk@v4.

import * as chalk from 'chalk';

console.log(chalk.bgCyan('hello'));
npm run test

> [email protected] test
> jest --coverage

  console.log
    hello

from node-typescript-boilerplate.

danwt avatar danwt commented on May 9, 2024

Did you get it solved @whoisdominic?

from node-typescript-boilerplate.

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.