mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
test: bun test (#2798)
* 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>
This commit is contained in:
21
scripts/fixBunTestExtension.js
Normal file
21
scripts/fixBunTestExtension.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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'"))
|
||||
}),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user