Skip to content

Commit

Permalink
The minification continues
Browse files Browse the repository at this point in the history
  • Loading branch information
niik committed Nov 20, 2024
1 parent 97099dc commit 1a28fb4
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions script/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@ import { spawn } from 'child_process'
import { join } from 'path'
import { readdir } from 'fs/promises'

function reporter(r) {
return ['--test-reporter', r, '--test-reporter-destination', 'stdout']
}

const files = await readdir('test', { recursive: true }).then(x =>
x.filter(f => f.endsWith('-test.ts')).map(f => join('test', f))
)

const reporterDestinationArgs = ['--test-reporter-destination', 'stdout']
const specTestReporterArgs = [
'--test-reporter',
'spec',
...reporterDestinationArgs,
]

const testReporterArgs = process.env.GITHUB_ACTIONS
? [
'--test-reporter',
'node-test-github-reporter',
...reporterDestinationArgs,
...specTestReporterArgs,
]
: specTestReporterArgs

process.env.LOCAL_GIT_DIRECTORY = 'git'
const args = ['--import', 'tsx', ...testReporterArgs, '--test', ...files]

const args = [
...['--import', 'tsx'],
'--test',
...reporter('spec'),
...(process.env.GITHUB_ACTIONS ? reporter('node-test-github-reporter') : []),
...files,
]

spawn('node', args, { stdio: 'inherit' }).on('exit', process.exit)

0 comments on commit 1a28fb4

Please sign in to comment.