diff --git a/reference/e2e/mail-relay-fixture.ts b/reference/e2e/mail-relay-fixture.ts index cae1198..d83ab9a 100644 --- a/reference/e2e/mail-relay-fixture.ts +++ b/reference/e2e/mail-relay-fixture.ts @@ -8,3 +8,10 @@ export const E2E_MAIL_RELAY_URL = process.env.E2E_MAIL_RELAY_URL || undefined /** `iapl({ mail })` for the test, `undefined` (the plugin's defaults) otherwise. */ export const e2eMail = E2E_MAIL_RELAY_URL ? { relay: { retryBackoffMs: 50, url: E2E_MAIL_RELAY_URL } } : undefined + +/** + * `iapl({ developmentHosts })` for a test that plays a development address on this machine (the built-in + * pattern, `*.dev.netscale.pl`, cannot be served from localhost): E2E_DEVELOPMENT_HOSTS, comma-separated + * patterns. `undefined` (the plugin's built-in list) otherwise. + */ +export const e2eDevelopmentHosts = process.env.E2E_DEVELOPMENT_HOSTS ? process.env.E2E_DEVELOPMENT_HOSTS.split(',').map((p) => p.trim()).filter(Boolean) : undefined diff --git a/reference/src/payload.config.ts b/reference/src/payload.config.ts index 5b44e36..46802a5 100644 --- a/reference/src/payload.config.ts +++ b/reference/src/payload.config.ts @@ -20,7 +20,7 @@ import { Posts } from './collections/Posts' // @starter:endif // @starter:if demo import { E2E_LATE_STAFF, E2E_STAFF_SLUGS, e2eEarlyStaff, e2eLateStaff } from '../e2e/late-staff-fixture' -import { e2eMail } from '../e2e/mail-relay-fixture' +import { e2eDevelopmentHosts, e2eMail } from '../e2e/mail-relay-fixture' // @starter:endif import { contentConfig } from './content.config' import { db } from './db' @@ -68,6 +68,8 @@ export default buildConfig({ // @starter:if demo // a test fixture: `undefined` (the plugin's defaults) without E2E_MAIL_RELAY_URL (e2e/mail-relay-fixture.ts) mail: e2eMail, + // a test fixture: `undefined` (the built-in list) without E2E_DEVELOPMENT_HOSTS + developmentHosts: e2eDevelopmentHosts, // (the staffCollections entry exists only for e2e/late-staff.spec.ts, with E2E_LATE_STAFF=1) access: { authCollection: 'users', ...(E2E_LATE_STAFF ? { staffCollections: E2E_STAFF_SLUGS } : {}) }, // @starter:else