mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 21:07:47 +00:00
* Forces the AL2 build container image for fixtures that depend on it, via `engines.node` in package.json for most cases. * The `testDeployment()` function was updated to send `projectSettings.nodeVersion` in the POST body, to mimic the behavior in CLI. * For Go, Ruby, and Python tests, the `projectSettings.nodeVersion` property is set "globally" in the Jest setup file, so that individual fixtures didn't need to be adjusted.
28 lines
876 B
TypeScript
28 lines
876 B
TypeScript
import { basename, join } from 'path';
|
|
import { lstatSync, readdirSync } from 'fs';
|
|
|
|
export async function deployExample(filename: string) {
|
|
const { testDeployment } = require('../../test/lib/deployment/test-deployment.js');
|
|
const example = basename(filename).replace(/\.test\.ts$/, '');
|
|
await testDeployment(join(process.cwd(), example));
|
|
}
|
|
|
|
export function getExamples() {
|
|
const dirname = join(__dirname, '..');
|
|
const examples = readdirSync(dirname)
|
|
.map(example =>
|
|
({
|
|
exampleName: example,
|
|
examplePath: join(dirname, example),
|
|
testPath: join(dirname, '__tests__', 'integration', `${example}.test.ts`),
|
|
})
|
|
)
|
|
.filter(o =>
|
|
!o.exampleName.startsWith('.') &&
|
|
!o.exampleName.startsWith('_') &&
|
|
o.exampleName !== 'node_modules' &&
|
|
lstatSync(o.examplePath).isDirectory()
|
|
);
|
|
return examples;
|
|
}
|