1
2
3
4
5
6
7
8
9
10
// node --test: compose.ts writes example.json (after npm ci).
import assert from 'node:assert/strict'
import { execFileSync } from 'node:child_process'
import { readFile } from 'node:fs/promises'
import { test } from 'node:test'
test('compose.ts writes example.json', async () => {
const root = new URL('..', import.meta.url)
assert.equal(execFileSync(process.execPath, [new URL('compose.ts', root).pathname], { encoding: 'utf8' }), await readFile(new URL('example.json', root), 'utf8'))
})