JoshuaKGoldberg / console-fail-test

Gently fails test runs if the console was used during them. 📢
MIT License
13 stars 5 forks source link

🚀 Feature: Export types #531

Open joel-daros opened 2 weeks ago

joel-daros commented 2 weeks ago

Bug Report Checklist

Overview

I’m testing console-fail-test in one of our projects within our monorepo. Our Vitest env is configured using a single vitest.config file pointing to a setupTest.ts file inside each monorepo project, so I can’t change the shared vitest config, because it will affect all projects.

Note that my setupTest.ts is a TS file, so when I’m importing console-fail-test TS is complaining about missing declaration types for this package:

As a workaround I had to add a couple of TS and Eslint ignores to bypass this issue:

// setupTest.ts

// @ts-expect-error console-fail-test is not exporting types
import { cft } from "console-fail-test";

// eslint-disable-next-line @typescript-eslint/no-unsafe-call
cft();

Additional Info

No response

JoshuaKGoldberg commented 2 weeks ago

Ah, I would have thought this would have already been done by #209. Definitely a bug that should be fixed. Thanks for filing!

JoshuaKGoldberg commented 2 weeks ago

@all-contributors please add @joel-daros for ideas.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action. Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed. ...and of course, thank you for contributing! 💙

allcontributors[bot] commented 2 weeks ago

@JoshuaKGoldberg

I've put up a pull request to add @joel-daros! :tada:

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.