File size: 617 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { globSync } from 'glob'
import { readFileSync } from 'fs'
import { collectFlags } from '../lib'

// scanUniqueFlagCombos() is used to generate a list of unique flag combinations
// based on calls to baseURLFromFlags in the integration tests.
export function scanUniqueFlagCombos(): string[] {
  const flags = new Set<string>()
  const files = globSync('test/integration/**/*.spec.ts')

  for (const file of files) {
    const content = readFileSync(file, 'utf8')
    const flagSets = collectFlags(content)
    for (const flagSet of flagSets) flags.add(flagSet)
  }

  return Array.from(flags.keys()).sort()
}