UNPKG

gmail-tester-extended

Version:

A simple NodeJS gmail client which checks the inbox for specific message existance

37 lines (33 loc) 1.15 kB
// *********************************************************** // This example plugins/index.js can be used to load plugins // // You can change the location of this file or turn off loading // the plugins file with the 'pluginsFile' configuration option. // // You can read more here: // https://on.cypress.io/plugins-guide // *********************************************************** // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) /// <reference types="Cypress" /> const debug = require("debug"); const path = require("path"); const gmail_tester = require("../../../gmail-tester-extended"); module.exports = (on, config) => { on("before:browser:launch", (browser = {}, args) => { if (browser.name === "chrome") { args.push("--remote-debugging-port=9221"); return args; } }); on("task", { "gmail:get-messages": async args => { const messages = await gmail_tester.get_messages( path.resolve(__dirname, "credentials.json"), path.resolve(__dirname, "token.json"), args.options ); return messages; } }); };