use cross-env to send parameters in an easier manner

This commit is contained in:
theofficialomega
2025-07-30 22:48:52 +02:00
parent 69970ccf1a
commit 59a23b743c
11 changed files with 2378 additions and 1272 deletions

View File

@@ -1,15 +1,10 @@
import { pathToFileURL } from 'node:url'
import { execSync } from 'child_process'
import os, { EOL } from 'node:os'
import { EOL } from 'node:os'
import * as fs from 'fs-extra'
import * as glob from 'glob'
let ENV_VAR =
'STREAMS_DIR=tests/__data__/input/playlist_generate DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output/.gh-pages LOGS_DIR=tests/__data__/output/logs'
if (os.platform() === 'win32') {
ENV_VAR =
'SET "STREAMS_DIR=tests/__data__/input/playlist_generate" && SET "DATA_DIR=tests/__data__/input/data" && SET "PUBLIC_DIR=tests/__data__/output/.gh-pages" && SET "LOGS_DIR=tests/__data__/output/logs" &&'
}
const ENV_VAR = 'cross-env STREAMS_DIR=tests/__data__/input/playlist_generate DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output/.gh-pages LOGS_DIR=tests/__data__/output/logs'
beforeEach(() => {
fs.emptyDirSync('tests/__data__/output')
@@ -31,7 +26,7 @@ describe('playlist:generate', () => {
})
playlists.forEach((filepath: string) => {
expect(content(`tests/__data__/output/${filepath}`), filepath).toBe(
expect(content(`tests/__data__/output/${filepath}`)).toBe(
content(`tests/__data__/expected/playlist_generate/${filepath}`)
)
})