Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
44d9cf13cThis file is pinned to the selected release. Download the original to open it in your design tool.
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import test from 'node:test'
const workflowPath = new URL(
'../.github/workflows/deploy-ftp.yml',
import.meta.url
)
/**
* Verifies the FTP workflow deploys the PHP metadata directory used by LIVE.
*/
test('ftp workflow deploys the api directory', async () => {
const workflow = await readFile(workflowPath, 'utf8')
assert.match(workflow, /api:\s*\n\s*- 'api\/\*\*'/)
assert.match(workflow, /name: Deploy api to \.\/api\//)
assert.match(workflow, /local-dir: \.\/api\//)
assert.match(workflow, /server-dir: \.\/api\//)
})
/**
* Verifies the API deploy skips `.htaccess` so FTP hosts that reset dotfile
* uploads can still publish the PHP metadata fallback.
*/
test('ftp workflow excludes api htaccess from FTP sync', async () => {
const workflow = await readFile(workflowPath, 'utf8')
assert.match(
workflow,
/name: Deploy api to \.\/api\/[\s\S]*?exclude: \|[\s\S]*?\*\*\/\.htaccess/
)
})
/**
* Verifies the FTP workflow deploys the package manifest to the LIVE document
* root so the PHP metadata endpoint can read the current app version.
*/
test('ftp workflow deploys package.json to the live root on dependency changes', async () => {
const workflow = await readFile(workflowPath, 'utf8')
assert.match(workflow, /name: Stage package manifest for LIVE/)
assert.match(workflow, /if: steps\.changes\.outputs\.deps == 'true'/)
assert.match(workflow, /mkdir -p \.deploy-root/)
assert.match(workflow, /cp package\.json \.deploy-root\/package\.json/)
assert.match(
workflow,
/name: Deploy package manifest to \.\/[\s\S]*?local-dir: \.\/\.deploy-root\/[\s\S]*?server-dir: \.\//
)
})