Merge pull request #19 from PeterCardenas/ensure-tests-dir

fix: ensure tests directory exists before checking it
This commit is contained in:
mr. m 2025-03-30 11:14:53 +02:00 committed by GitHub
commit f2e5f5a89e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,7 @@ import { copyFile } from 'node:fs/promises'
import { dirname, resolve } from 'node:path' import { dirname, resolve } from 'node:path'
import glob from 'tiny-glob' import glob from 'tiny-glob'
import { appendToFileSync, mkdirp } from '../../utils' import { appendToFileSync, ensureDirectory, mkdirp } from '../../utils'
import { config } from '../..' import { config } from '../..'
import { CURRENT_DIR, ENGINE_DIR, SRC_DIR, TESTS_DIR } from '../../constants' import { CURRENT_DIR, ENGINE_DIR, SRC_DIR, TESTS_DIR } from '../../constants'
import { IMelonPatch } from './command' import { IMelonPatch } from './command'
@ -104,6 +104,7 @@ export async function get(): Promise<ICopyPatch[]> {
} }
}) })
await ensureDirectory('./tests')
const testFiles = await glob('./tests/**/*', { const testFiles = await glob('./tests/**/*', {
filesOnly: true, filesOnly: true,
cwd: '.', cwd: '.',