1 import { basename, extname, isAbsolute, join, resolve } from 'path'
6 if (rootPath) return rootPath
10 if (basename(rootPath) === 'common') rootPath = resolve(rootPath, '..')
11 if (basename(rootPath) === 'core-utils') rootPath = resolve(rootPath, '..')
12 if (basename(rootPath) === 'shared') rootPath = resolve(rootPath, '..')
13 if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
14 if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
19 function buildPath (path: string) {
20 if (isAbsolute(path)) return path
22 return join(root(), path)
25 function getLowercaseExtension (filename: string) {
26 const ext = extname(filename) || ''
28 return ext.toLowerCase()
31 function buildAbsoluteFixturePath (path: string, customCIPath = false) {
32 if (isAbsolute(path)) return path
34 if (customCIPath && process.env.GITHUB_WORKSPACE) {
35 return join(process.env.GITHUB_WORKSPACE, 'fixtures', path)
38 return join(root(), 'server', 'tests', 'fixtures', path)
44 buildAbsoluteFixturePath,