mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
f18ee36dc0
* chore: add @astrojs/webapi * chore: update package.json * fix: update file case * fix: remove lowercase file * chore: update tests to use mocha * chore: update LICENSE
28 lines
544 B
JavaScript
28 lines
544 B
JavaScript
import { fileURLToPath } from 'url'
|
|
|
|
export { strict as assert } from 'assert'
|
|
|
|
export const pathFrom = (...args) => fileURLToPath(args.reduce((url, bit) => new URL(bit, url), new URL('file:')))
|
|
|
|
export const test = async (setup) => {
|
|
console.log(`Testing Node ${process.version}:`)
|
|
console.log('')
|
|
|
|
for (const test of setup()) {
|
|
try {
|
|
console.log(`- ${test.name}`)
|
|
|
|
await test.test()
|
|
} catch (error) {
|
|
console.error(error)
|
|
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
console.log('')
|
|
console.log('Pass!')
|
|
console.log('')
|
|
|
|
process.exit(0)
|
|
}
|