test: run prettier on tsconfig.json after test

This commit is contained in:
Elliot DeNolf
2024-03-25 13:36:29 -04:00
parent 8d78d07415
commit 43f91ca42c

View File

@@ -2,6 +2,7 @@ import { existsSync, promises } from 'fs'
import json5 from 'json5'
import path from 'path'
import { fileURLToPath } from 'url'
import { execSync } from 'child_process'
const { readFile, writeFile, rm } = promises
const filename = fileURLToPath(import.meta.url)
@@ -39,6 +40,8 @@ export const createTestHooks = async (testSuiteName = '_community') => {
tsConfig.compilerOptions.paths['@payload-config'] = ['./test/_community/config.ts']
await writeFile(tsConfigPath, JSON.stringify(tsConfig, null, 2) + '\n')
execSync(`prettier --write ${tsConfigPath}`, { cwd: path.resolve(dirname, '../') })
},
}
}