mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
* test: bun test * Update package.json * ci: update bun version * Update package.json * Update package.json * test * ci: update bun * chore(ci): update bun version --------- Co-authored-by: H01001000 <heiheiho000@gmail.com>
22 lines
613 B
JavaScript
22 lines
613 B
JavaScript
import fs from 'node:fs'
|
|
|
|
const dirs = ['']
|
|
try {
|
|
fs.rmSync('bunTestsDist', { recursive: true, force: true })
|
|
} catch {
|
|
//
|
|
}
|
|
for await (const dir of dirs) {
|
|
await Promise.all(
|
|
fs.readdirSync(`tests${dir}`).map(async (file) => {
|
|
if (!file.endsWith('.ts') && !file.includes('.')) {
|
|
dirs.push(`${dir}/${file}`)
|
|
return
|
|
}
|
|
const content = await fs.promises.readFile(`tests${dir}/${file}`, 'utf-8')
|
|
fs.mkdirSync(`bunTestsDist${dir}`, { recursive: true })
|
|
fs.promises.writeFile(`bunTestsDist${dir}/${file}`, content.replace(/'mocha'/g, "'bun:test'"))
|
|
}),
|
|
)
|
|
}
|