1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import { mkdirSync } from 'fs' import { join } from 'path' const SCREENSHOTS_DIRECTORY = 'screenshots' function createScreenshotsDirectory () { mkdirSync(SCREENSHOTS_DIRECTORY, { recursive: true }) } function getScreenshotPath (filename: string) { return join(SCREENSHOTS_DIRECTORY, filename) } export { createScreenshotsDirectory, getScreenshotPath }