File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import test , { ExecutionContext } from 'ava'
2+ import fs from 'node:fs'
3+ import path from 'node:path'
24
35import { default as puid } from './lib/puid'
46import { dataIds , dataParams , fileBytes } from './lib/util'
57
68// Allow skipping data-driven cross-repo tests in CI or when PUID_SKIP_DATA_TESTS is set
7- const it = process . env . PUID_SKIP_DATA_TESTS ? test . skip : test
9+ // Also skip automatically if the cross-repo data directory is not present
10+ const dataRoot = path . join ( __dirname , '..' , '..' , 'data' )
11+ const skipData = ! ! process . env . PUID_SKIP_DATA_TESTS || ! ! process . env . CI || ! ! process . env . GITHUB_ACTIONS || ! fs . existsSync ( dataRoot )
12+ const it = skipData ? test . skip : test
813
914const testData = ( t : ExecutionContext , dataName : string ) => {
1015 const params = dataParams ( dataName )
You can’t perform that action at this time.
0 commit comments