Comments (3)
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.
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.
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)
- [Feature]: testEnvironment per file type
- [Bug] `URLSearchParams.delete` Execution results differ HOT 1
- [Bug]: expect URL objects are compared by href HOT 1
- [Bug]: Asymmetric matchers in error of observable are timing out instead of failing
- [Feature]: support biome for jest-snapshot formatting
- [Feature]: Dynamic test retries based on error messages
- [Bug]: mocking a function which is dereferenced using require syntax doesnt get mocked
- [Bug]: getState from jest-circus gets state from parellel environment HOT 1
- [Docs]: repetitive sentences
- TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED') who can help me ? HOT 1
- [Feature]: Add a "toHaveBeenCalledExactlyOnceWith" assertion (name TBD) HOT 1
- [Bug]: isolateModules doesn't work properly with auto mocked modules (reopen #14443)
- jest doesn't work with virtual driver created with subst on Windows HOT 3
- [Bug]: jest isolation conflicts with better-sqlite3 native modules
- [Bug]: Native fetch Arrays Incorrectly Matched
- TypeError: Cannot read properties of undefined (reading 'data') HOT 1
- [Feature]: Update deprecated subdependencies: [email protected], [email protected] in @jest/types HOT 1
- TypeError: Cannot read properties of undefined (reading 'data')
- Using setupFiles inside reporters HOT 2
- [Bug]: toHaveBeenCalledWith matcher matches with any URL object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest.