GithubHelp home page GithubHelp logo

Comments (3)

mrazauskas avatar mrazauskas commented on May 4, 2024

Did you try:

npx jest --json --no-color

or:

FORCE_COLOR=false npx jest --json

For me these work as expected, i.e. there no no ansi escape codes in the output. Although I don’t see failureMessage or testExecError in the output too. Might be there are issues with reproduction steps.

from jest.

aecepogluARUP avatar aecepogluARUP commented on May 4, 2024

I see it regularly. My test files are in typescript and I use ts-jest

// hello.test.ts
test('sum', () => { expec(1+2).toEqual(3) }) $$
// jest.config.ts
import type {Config} from 'jest';
const config: Config = { preset: 'ts-jest' };
export default config;

node_modules/.bin/jest ./hello.test.ts --json

{"numFailedTestSuites":1,"numFailedTests":0,"numPassedTestSuites":0,"numPassedTests":0,"numPendingTestSuites":0,"numPendingTests":0,"numRuntimeErrorTestSuites":1,"numTodoTests":0,"numTotalTestSuites":1,"numTotalTests":0,"openHandles":[],"snapshot":{"added":0,"didUpdate":false,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0},"startTime":1712138134523,"success":false,"testResults":[{"assertionResults":[],"coverage":{},"endTime":1712138135196,"message":"  ● Test suite failed to run\n\n    \u001b[96mhello.test.ts\u001b[0m:\u001b[93m1\u001b[0m:\u001b[93m21\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2552: \u001b[0mCannot find name 'expec'. Did you mean 'expect'?\n\n    \u001b[7m1\u001b[0m test('sum', () => { expec(1+2).toEqual(3) })\n    \u001b[7m \u001b[0m \u001b[91m                    ~~~~~\u001b[0m\n\n      \u001b[96mnode_modules/@types/jest/index.d.ts\u001b[0m:\u001b[93m14\u001b[0m:\u001b[93m15\u001b[0m\n        \u001b[7m14\u001b[0m declare const expect: jest.Expect;\n        \u001b[7m  \u001b[0m \u001b[96m              ~~~~~~\u001b[0m\n        'expect' is declared here.\n    \u001b[96mhello.test.ts\u001b[0m:\u001b[93m2\u001b[0m:\u001b[93m1\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2304: \u001b[0mCannot find name '$$'.\n\n    \u001b[7m2\u001b[0m $$\n    \u001b[7m \u001b[0m \u001b[91m~~\u001b[0m\n","name":"/home/path/to/hello.test.ts","startTime":1712138135196,"status":"failed","summary":""}],"wasInterrupted":false}

from jest.

mrazauskas avatar mrazauskas commented on May 4, 2024

ts-jest is managed in its own repo. Any issues with it must be reported there.

As already mentioned, FORCE_COLOR=false does what you want.

from jest.

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.