-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
import { afterEach, mock } from 'bun:test' | ||
import { beforeEach, afterEach, mock } from 'bun:test' | ||
import { evaluatorCache } from '~/staxfile/evaluator' | ||
import { mkdirSync, rmSync } from 'fs' | ||
import { join } from 'path' | ||
import settings from '~/settings' | ||
|
||
process.env.STAX_HOME = join(__dirname, '../tmp/.stax-tests') | ||
|
||
beforeEach(() => { | ||
mkdirSync(process.env.STAX_HOME) | ||
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
Check failure on line 10 in tests/setup.js GitHub Actions / testsENOENT: No such file or directory
|
||
settings.write('environment', 'test') | ||
}) | ||
|
||
afterEach(() => { | ||
// Add manual cleanup of any existing tmp files | ||
mock.restore() | ||
evaluatorCache.clear() | ||
rmSync(process.env.STAX_HOME, { recursive: true, force: true }) | ||
}) |