You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jest 26 has already come, but this TODO wasn't fulfilled before 26.
Motivation
Implementing this into Jest would keep the overall project build config cleaner.
The alternative is to transpile the custom reporter manually from TS to JS or have to write the custom reporter in JS. These necessitate more build and IDE configuration. It's a similar motivation for plain TS files underneath __tests__ currently "just working".
Example
User writes a TypeScript custom reporter. And without compiling the TS, they can specify the TS script directly as a custom reporter.
There may be a chicken and egg problem with a Typescript config, but there shouldn't be one for reporters. We can currently load Typescript tests without compiling so why not TS reporters?
The text was updated successfully, but these errors were encountered:
@aslettemark what i did:
You create intermediate js file that uses ts-node/babel-node register and requiring the actual file
// reporter.js// jest can't transpile transformers on the fly so we help him// https://github.com/facebook/jest/issues/10105/* eslint-disable import/no-extraneous-dependencies */consttsNode=require('ts-node');tsNode.register({transpileOnly: true,compilerOptions: require('@testim/root-cause-jest/tsconfig').compilerOptions,});constReporter=require('@testim/root-cause-jest/lib/reporter/default');module.exports=Reporter;
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
I couldn't find an existing issue talking about this.
🚀 Feature Proposal
It would be great to be able to load TypeScript custom reporters directly.
I don't know if implementing this TODO allows for this:
https://github.com/facebook/jest/blob/3f107a33775cdff94cab6993741e3a1a22e00aa0/packages/jest-core/src/TestScheduler.ts#L329-L330
Jest 26 has already come, but this TODO wasn't fulfilled before 26.
Motivation
Implementing this into Jest would keep the overall project build config cleaner.
The alternative is to transpile the custom reporter manually from TS to JS or have to write the custom reporter in JS. These necessitate more build and IDE configuration. It's a similar motivation for plain TS files underneath
__tests__
currently "just working".Example
User writes a TypeScript custom reporter. And without compiling the TS, they can specify the TS script directly as a custom reporter.
It would look something like this in the config.
Pitch
There may be a chicken and egg problem with a Typescript config, but there shouldn't be one for reporters. We can currently load Typescript tests without compiling so why not TS reporters?
The text was updated successfully, but these errors were encountered: