Skip to content
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

TypeScript based Config for Cypress 10+ #148

Closed
henryruhs opened this issue Jun 4, 2022 · 1 comment
Closed

TypeScript based Config for Cypress 10+ #148

henryruhs opened this issue Jun 4, 2022 · 1 comment

Comments

@henryruhs
Copy link

henryruhs commented Jun 4, 2022

I wonder if this is the correct way to implement this plugin to a TypeScript based project.

support/e2e.ts

import 'cypress-terminal-report/src/installLogsCollector';

cypress.config.ts

import { defineConfig } from 'cypress';
import installLogsPrinter from 'cypress-terminal-report/src/installLogsPrinter';

export default defineConfig(
{
	e2e:
	{
		setupNodeEvents(on : Cypress.PluginEvents)
		{
			installLogsPrinter(on);
		}
	}
});

It says that installLogsPrinter is not a fuction but observing the d.tsgives me that information.

declare function installLogsPrinter(on: Cypress.PluginEvents, options?: PluginOptions): void;
export default installLogsPrinter;
@archfz
Copy link
Owner

archfz commented Jun 5, 2022

https://github.com/archfz/cypress-terminal-report-demo
Please see here.
The solution is to add esModuleInterop: true in tsconfig.
I will update the readme as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants