e2e-mail 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,8 +13,6 @@ export type SearchFilters = {
|
|
|
13
13
|
export type PollingOptions = {
|
|
14
14
|
/** Timeout before exisitng polling loop */
|
|
15
15
|
timeout?: number;
|
|
16
|
-
/** Interval for polling search */
|
|
17
|
-
interval?: number;
|
|
18
16
|
/** If true, delete the email immediately when fetched
|
|
19
17
|
* @default true
|
|
20
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/mailtm/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/mailtm/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
|
package/dist/cypress.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E2EMailClient as s } from "./core/mailtm/index.js";
|
|
2
2
|
let i = null;
|
|
3
3
|
Cypress.Commands.add("initializeMailbox", (e, t) => {
|
|
4
|
-
cy.
|
|
4
|
+
cy.log(`Initializing mailbox ${e}`), cy.then(() => (i = new s(e, t), i.initialize()));
|
|
5
5
|
});
|
|
6
6
|
Cypress.Commands.add("removeMailbox", () => {
|
|
7
7
|
cy.then(() => {
|
package/dist/cypress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.js","sources":["../src/cypress/cypress.ts"],"sourcesContent":["import { E2EMailClient } from \"../core/mailtm\";\nimport type { PollingOptions, SearchFilters } from \"../core/mailtm/types\";\n\nlet mailClient: E2EMailClient | null = null;\ndeclare global {\n namespace Cypress {\n interface Chainable {\n /**\n * Initialize mailbox session\n * @param address Email address\n * @param password Account password\n */\n initializeMailbox(address: string, password: string): Chainable<void>;\n\n /**\n * Get most recent inbox match for an existing or new mail account\n * @param filters Optional search filters\n * @param options Configuration for message polling\n */\n searchMailbox(\n filters?: SearchFilters,\n options?: PollingOptions,\n ): Chainable<void>;\n\n /**\n * Delete the account mailbox and all its emails from the server\n */\n removeMailbox(): Chainable<void>;\n }\n }\n}\n\nCypress.Commands.add(\"initializeMailbox\", (address, password) => {\n cy.
|
|
1
|
+
{"version":3,"file":"cypress.js","sources":["../src/cypress/cypress.ts"],"sourcesContent":["import { E2EMailClient } from \"../core/mailtm\";\nimport type { PollingOptions, SearchFilters } from \"../core/mailtm/types\";\n\nlet mailClient: E2EMailClient | null = null;\ndeclare global {\n namespace Cypress {\n interface Chainable {\n /**\n * Initialize mailbox session\n * @param address Email address\n * @param password Account password\n */\n initializeMailbox(address: string, password: string): Chainable<void>;\n\n /**\n * Get most recent inbox match for an existing or new mail account\n * @param filters Optional search filters\n * @param options Configuration for message polling\n */\n searchMailbox(\n filters?: SearchFilters,\n options?: PollingOptions,\n ): Chainable<void>;\n\n /**\n * Delete the account mailbox and all its emails from the server\n */\n removeMailbox(): Chainable<void>;\n }\n }\n}\n\nCypress.Commands.add(\"initializeMailbox\", (address, password) => {\n cy.log(`Initializing mailbox ${address}`);\n\n cy.then(() => {\n mailClient = new E2EMailClient(address, password);\n return mailClient.initialize();\n });\n});\n\nCypress.Commands.add(\"removeMailbox\", () => {\n cy.then(() => {\n if (!mailClient) {\n throw new Error(\n \"Mailbox client not initialized. Call cy.initializeMailbox() first.\",\n );\n }\n\n return mailClient.dispose();\n });\n});\n\nCypress.Commands.add(\"searchMailbox\", (filters, options = {}) => {\n const {\n timeout = Cypress.config().defaultCommandTimeout ?? 4000,\n autoDelete,\n } = options;\n\n return cy.then({ timeout: timeout + 2000 }, async () => {\n if (!mailClient) {\n throw new Error(\n \"Mailbox client not initialized. Call cy.initializeMailbox() first.\",\n );\n }\n\n // Get most recent match\n const message = await mailClient.pollMessages(filters, {\n timeout,\n autoDelete,\n });\n const html = Array.isArray(message.html) ? message.html[0] : message.html;\n\n // Write HTML to Cypress DOM\n if (html) {\n cy.document().then((doc) => {\n doc.open();\n doc.write(String(html));\n doc.close();\n });\n }\n });\n});\n"],"names":["mailClient","address","password","E2EMailClient","filters","options","timeout","autoDelete","message","html","doc"],"mappings":";AAGA,IAAIA,IAAmC;AA6BvC,QAAQ,SAAS,IAAI,qBAAqB,CAACC,GAASC,MAAa;AAC/D,KAAG,IAAI,wBAAwBD,CAAO,EAAE,GAExC,GAAG,KAAK,OACND,IAAa,IAAIG,EAAcF,GAASC,CAAQ,GACzCF,EAAW,WAAA,EACnB;AACH,CAAC;AAED,QAAQ,SAAS,IAAI,iBAAiB,MAAM;AAC1C,KAAG,KAAK,MAAM;AACZ,QAAI,CAACA;AACH,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAIJ,WAAOA,EAAW,QAAA;AAAA,EACpB,CAAC;AACH,CAAC;AAED,QAAQ,SAAS,IAAI,iBAAiB,CAACI,GAASC,IAAU,OAAO;AAC/D,QAAM;AAAA,IACJ,SAAAC,IAAU,QAAQ,OAAA,EAAS,yBAAyB;AAAA,IACpD,YAAAC;AAAA,EAAA,IACEF;AAEJ,SAAO,GAAG,KAAK,EAAE,SAASC,IAAU,IAAA,GAAQ,YAAY;AACtD,QAAI,CAACN;AACH,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAKJ,UAAMQ,IAAU,MAAMR,EAAW,aAAaI,GAAS;AAAA,MACrD,SAAAE;AAAA,MACA,YAAAC;AAAA,IAAA,CACD,GACKE,IAAO,MAAM,QAAQD,EAAQ,IAAI,IAAIA,EAAQ,KAAK,CAAC,IAAIA,EAAQ;AAGrE,IAAIC,KACF,GAAG,SAAA,EAAW,KAAK,CAACC,MAAQ;AAC1B,MAAAA,EAAI,KAAA,GACJA,EAAI,MAAM,OAAOD,CAAI,CAAC,GACtBC,EAAI,MAAA;AAAA,IACN,CAAC;AAAA,EAEL,CAAC;AACH,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "e2e-mail",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "A zero-config solution for testing email in major testing frameworks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,10 +59,9 @@
|
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@playwright/test": "^1.49.0",
|
|
62
|
-
"@types/node": "^25.9.
|
|
62
|
+
"@types/node": "^25.9.3",
|
|
63
63
|
"cypress": "^15.17.0",
|
|
64
|
-
"e2e-mail": "^0.0.
|
|
65
|
-
"openapi-fetch": "^0.17.0",
|
|
64
|
+
"e2e-mail": "^0.0.17",
|
|
66
65
|
"openapi-typescript": "^7.13.0",
|
|
67
66
|
"tsx": "^4.22.4",
|
|
68
67
|
"typescript": "^5.9.0",
|
|
@@ -81,5 +80,8 @@
|
|
|
81
80
|
"playwright": {
|
|
82
81
|
"optional": true
|
|
83
82
|
}
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"openapi-fetch": "^0.17.0"
|
|
84
86
|
}
|
|
85
87
|
}
|