Update tests

This commit is contained in:
freearhey
2026-05-24 02:12:34 +03:00
parent 147abb1899
commit 8ad22c2488
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -2,6 +2,8 @@ import { execSync } from 'child_process'
import { pathToFileURL } from 'node:url'
import fs from 'fs-extra'
const ENV_VAR = 'cross-env DATA_DIR=tests/__data__/input/data'
beforeEach(() => {
fs.emptyDirSync('tests/__data__/output')
fs.copySync(
@@ -12,7 +14,7 @@ beforeEach(() => {
describe('channels:format', () => {
it('can format *.channels.xml files', () => {
const cmd = 'npm run channels:format --- tests/__data__/output/example.com.channels.xml'
const cmd = `${ENV_VAR} npm run channels:format --- tests/__data__/output/example.com.channels.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
+1 -1
View File
@@ -3,7 +3,7 @@ import fs from 'fs-extra'
import { pathToFileURL } from 'node:url'
const ENV_VAR =
'cross-env SITES_DIR=tests/__data__/input/guides_export/sites API_DIR=tests/__data__/output'
'cross-env SITES_DIR=tests/__data__/input/guides_export/sites DATA_DIR=tests/__data__/input/data API_DIR=tests/__data__/output'
beforeEach(() => {
fs.emptyDirSync('tests/__data__/output')