diff options
Diffstat (limited to '')
-rw-r--r-- | packages/create-astro/test/helpers.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/create-astro/test/helpers.js b/packages/create-astro/test/helpers.js new file mode 100644 index 000000000..295f9c650 --- /dev/null +++ b/packages/create-astro/test/helpers.js @@ -0,0 +1,13 @@ +import execa from 'execa'; +import path from 'path'; +import { fileURLToPath, pathToFileURL } from 'url'; + +const GITHUB_SHA = process.env.GITHUB_SHA || execa.sync('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 +};
\ No newline at end of file |