Skip to content

Commit 1dbed85

Browse files
authored
test: allow configuring test account slug (#1860)
1 parent efb06cf commit 1dbed85

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/utils/create-live-test-site.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
const {
2+
env: { NETLIFY_TEST_ACCOUNT_SLUG },
3+
} = require('process')
4+
15
const stripAnsi = require('strip-ansi')
26

37
const callCli = require('./call-cli')
@@ -23,7 +27,9 @@ const createLiveTestSite = async function (siteName) {
2327
if (!Array.isArray(accounts) || accounts.length <= 0) {
2428
throw new Error(`Can't find suitable account to create a site`)
2529
}
26-
const [account] = accounts
30+
const account = NETLIFY_TEST_ACCOUNT_SLUG
31+
? accounts.find(({ slug }) => slug === NETLIFY_TEST_ACCOUNT_SLUG)
32+
: accounts[0]
2733
const accountSlug = account.slug
2834
console.log(`Using account ${accountSlug} to create site: ${siteName}`)
2935
const cliResponse = await callCli(['sites:create', '--name', siteName, '--account-slug', accountSlug])

0 commit comments

Comments
 (0)