-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Cannot destructure property 'HTTP2_HEADER_CONTENT_ENCODING' of 'http2.constants' as it is undefined. #109
Comments
I had this problem, and it was caused by not setting up the task properly - requiring "gmail-tester" in the wrong place will cause that issue. You need to make sure that it runs as a For my implementation (Cypress 11), I had to do the following in cypress.config.ts: import { defineConfig } from 'cypress';
import * as path from 'path';
import * as gmail from 'gmail-tester';
export default defineConfig({
e2e: {
setupNodeEvents: (on) =>
on('task', {
'gmail:check': async (args) => {
const { from, to, subject } = args;
const email = await gmail.check_inbox(
path.resolve(__dirname, './path/to/credentials.json'),
path.resolve(__dirname, './path/to/token.json'),
{
subject: subject,
from: from,
to: to,
include_body: true,
wait_time_sec: 10,
max_wait_time_sec: 30,
}
);
return email;
},
}),
},
}); You can then call the task in a test by doing: cy.task('gmail:check', {
from: '[email protected]',
subject: 'Whatever',
}).then((email) => {
assert.isNotNull(email, `Email was found`);
}); Hope that helps! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see that this issue was filed before, but that was with a different implementation where they were able to circumvent the issue by commenting out the
require
line.My implementation is in a helper file:
The text was updated successfully, but these errors were encountered: