mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-28 06:20:12 +00:00
* test(utils): fix cant import collection * test(rest): await expect * fix(utils): deno compactability * test(utils): typing * fix(utils): add return type
24 lines
748 B
JavaScript
24 lines
748 B
JavaScript
import fs from 'node:fs'
|
|
|
|
const dirs = ['']
|
|
for await (const dir of dirs) {
|
|
await Promise.all(
|
|
fs.readdirSync(`denoTestsDist${dir}`).map(async (file) => {
|
|
if (!file.endsWith('.js')) {
|
|
dirs.push(`${dir}/${file}`)
|
|
return
|
|
}
|
|
const content = await fs.promises.readFile(`denoTestsDist${dir}/${file}`, 'utf-8')
|
|
await fs.promises.rm(`denoTestsDist${dir}/${file}`)
|
|
fs.promises.writeFile(
|
|
`denoTestsDist${dir}/${file.slice(-8) === '.spec.js' ? `${file.slice(0, -7)}test.js` : file}`,
|
|
content
|
|
.replace(/src\//g, 'dist/')
|
|
.replace(/\.ts/g, '.js')
|
|
.replace(/describe\.skip/g, 'describe.ignore')
|
|
.replace(/it\.skip/g, 'it.ignore'),
|
|
)
|
|
}),
|
|
)
|
|
}
|