{"version":3,"sources":["../../../src/common/tools/crawl.ts"],"names":["fs","path","validQueryPart","assert","unreachable","specFileSuffix","__filename","endsWith","crawlFilesRecursively","dir","subpathInfo","Promise","all","promises","readdir","map","d","p","join","stats","stat","isDirectory","isFile","files","filter","i","sep","concat","reduce","a","b","resolve","crawl","suiteDir","validate","existsSync","console","error","process","exit","filesToEnumerate","f","relative","replace","sort","entries","file","filepathWithoutExtension","substring","length","suite","basename","filename","env","STANDALONE_DEV_SERVER","mod","description","undefined","g","pathSegments","split","test","push","dirname","readme","readFileSync","trim","makeListing"],"mappings":"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","sourcesContent":["// Node can look at the filesystem, but JS in the browser can't.\n// This crawls the file tree under src/suites/${suite} to generate a (non-hierarchical) static\n// listing file that can then be used in the browser to load the modules containing the tests.\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport { SpecFile } from '../internal/file_loader.js';\nimport { validQueryPart } from '../internal/query/validQueryPart.js';\nimport { TestSuiteListingEntry, TestSuiteListing } from '../internal/test_suite_listing.js';\nimport { assert, unreachable } from '../util/util.js';\n\nconst specFileSuffix = __filename.endsWith('.ts') ? '.spec.ts' : '.spec.js';\n\nasync function crawlFilesRecursively(dir: string): Promise<string[]> {\n  const subpathInfo = await Promise.all(\n    (await fs.promises.readdir(dir)).map(async d => {\n      const p = path.join(dir, d);\n      const stats = await fs.promises.stat(p);\n      return {\n        path: p,\n        isDirectory: stats.isDirectory(),\n        isFile: stats.isFile(),\n      };\n    })\n  );\n\n  const files = subpathInfo\n    .filter(\n      i =>\n        i.isFile &&\n        (i.path.endsWith(specFileSuffix) ||\n          i.path.endsWith(`${path.sep}README.txt`) ||\n          i.path === 'README.txt')\n    )\n    .map(i => i.path);\n\n  return files.concat(\n    await subpathInfo\n      .filter(i => i.isDirectory)\n      .map(i => crawlFilesRecursively(i.path))\n      .reduce(async (a, b) => (await a).concat(await b), Promise.resolve([]))\n  );\n}\n\nexport async function crawl(\n  suiteDir: string,\n  validate: boolean = true\n): Promise<TestSuiteListingEntry[]> {\n  if (!fs.existsSync(suiteDir)) {\n    console.error(`Could not find ${suiteDir}`);\n    process.exit(1);\n  }\n\n  // Crawl files and convert paths to be POSIX-style, relative to suiteDir.\n  const filesToEnumerate = (await crawlFilesRecursively(suiteDir))\n    .map(f => path.relative(suiteDir, f).replace(/\\\\/g, '/'))\n    .sort();\n\n  const entries: TestSuiteListingEntry[] = [];\n  for (const file of filesToEnumerate) {\n    // |file| is the suite-relative file path.\n    if (file.endsWith(specFileSuffix)) {\n      const filepathWithoutExtension = file.substring(0, file.length - specFileSuffix.length);\n\n      const suite = path.basename(suiteDir);\n\n      if (validate) {\n        const filename = `../../${suite}/${filepathWithoutExtension}.spec.js`;\n\n        assert(!process.env.STANDALONE_DEV_SERVER);\n        const mod = (await import(filename)) as SpecFile;\n        assert(mod.description !== undefined, 'Test spec file missing description: ' + filename);\n        assert(mod.g !== undefined, 'Test spec file missing TestGroup definition: ' + filename);\n\n        mod.g.validate();\n      }\n\n      const pathSegments = filepathWithoutExtension.split('/');\n      for (const p of pathSegments) {\n        assert(validQueryPart.test(p), `Invalid directory name ${p}; must match ${validQueryPart}`);\n      }\n      entries.push({ file: pathSegments });\n    } else if (path.basename(file) === 'README.txt') {\n      const dirname = path.dirname(file);\n      const readme = fs.readFileSync(path.join(suiteDir, file), 'utf8').trim();\n\n      const pathSegments = dirname !== '.' ? dirname.split('/') : [];\n      entries.push({ file: pathSegments, readme });\n    } else {\n      unreachable(`Matched an unrecognized filename ${file}`);\n    }\n  }\n\n  return entries;\n}\n\nexport function makeListing(filename: string): Promise<TestSuiteListing> {\n  // Don't validate. This path is only used for the dev server and running tests with Node.\n  // Validation is done for listing generation and presubmit.\n  return crawl(path.dirname(filename), false);\n}\n"],"file":"crawl.js"}