You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
383 B
JavaScript

import { default as glob } from "tiny-glob"
export async function discoverTestFiles(options) {
const pattern = options?.pattern || "**/*.test.{js,cjs,mjs}"
const directory = options?.directory || "."
const files = await glob(pattern, {
cwd: directory,
})
const importUrls = files.map(f => f.replace("\\", "/")) // Silly Windows!
return importUrls
}