summaryrefslogtreecommitdiff
path: root/packages/create-astro/test/helpers.js
blob: 4f0b6ec3e64d66e0de49fb7b8209b7368cb6e387 (plain) (blame)
1
2
3
4
5
6
7
8
9
import { execaSync } from 'execa';
import path from 'path';
import { fileURLToPath, pathToFileURL } from 'url';

const GITHUB_SHA = process.env.GITHUB_SHA || execaSync('git', ['rev-parse', 'HEAD']).stdout; // process.env.GITHUB_SHA will be set in CI; if testing locally execa() will gather this
const FIXTURES_DIR = path.join(fileURLToPath(path.dirname(import.meta.url)), 'fixtures');
const FIXTURES_URL = pathToFileURL(FIXTURES_DIR + '/');

export { GITHUB_SHA, FIXTURES_DIR, FIXTURES_URL };