refactor: consolidate finance workflow modules
This commit is contained in:
13
web/tests/helpers/sourceSurface.mjs
Normal file
13
web/tests/helpers/sourceSurface.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
export function readSourceFile(relativePath) {
|
||||
return readFileSync(
|
||||
fileURLToPath(new URL(`../../src/${relativePath}`, import.meta.url)),
|
||||
'utf8'
|
||||
)
|
||||
}
|
||||
|
||||
export function readSourceSurface(relativePaths = []) {
|
||||
return relativePaths.map((relativePath) => readSourceFile(relativePath)).join('\n')
|
||||
}
|
||||
Reference in New Issue
Block a user