-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor tstyche#395 #1
Comments
Is that a hard requirement? Does this mean I should ship TSTyche as dual CJS/ESM package. Hm.. I was trying to avoid that. Could we try
There is That’s why I decided to keep only const eventEmitter = new EventEmitter();
eventEmitter.addReporter(firstReporter, secondReporter);
// do something
eventEmitter.removeReporter(secondReporter);
// do something more
eventEmitter.removeReporters(); There are also handlers. The difference is that handlers are called before reporters, so they can modify |
I don't think you'd need a full CJS build. I think it may be enough to alter the TSTyche "exports": {
".": {
+ "types": "./build/index.d.ts",
"import": "./build/index.js",
"require": "./build/index.cjs"
},
"./package.json": "./package.json",
- "./tstyche": "./build/tstyche.js"
+ "./tstyche": {
+ "types": "./build/tstyche.d.ts",
+ "import": "./build/tstyche.js",
+ }
}
}, The problem I'm working to solve is getting a CJS build of
But, of course, I can't update {
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Node",
"noEmit": false,
"outDir": "./build/cjs",
"target": "ES2016"
},
"include": ["./source/mocha.ts"],
"extends": "./tsconfig.json"
} |
As for the Reporter thing ... That may be leftover thinking from my initial approach. It looks like you already have the code in place to load a reporter from an imported file. So I think I can just alter the |
If I run const tstyche_1 = require("tstyche/tstyche"); If you run this in Node.js, it will blows up with:
Is this expected? In this case |
Before we can get this to build, we'll need to get the TSTyche API to expose a few things. Most of this is in tstyche/tstyche#395 already.
Add:
tstyche/tstyche
for CJS (also)Runner.addReporter
Keep:
*Result
typesRemove:
as-mocha
codeThe text was updated successfully, but these errors were encountered: