Skip to content

Commit

Permalink
Fixed bug that caused tests to fail in gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdf18 committed Jan 4, 2025
1 parent 8db426a commit dd15459
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/db.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ const db = require('../src/db');

const TEST_DB_DIR = path.join(__dirname, '../test-data/');

beforeAll(() => {
if (!fs.existsSync(TEST_DB_DIR)) {
fs.mkdirSync(TEST_DB_DIR);
}
});

afterAll(() => {
if (fs.existsSync(TEST_DB_DIR)) {
fs.rmSync(TEST_DB_DIR, { recursive: true, force: true });
}
});

function getCurrentTestDir() {
const state = expect.getState();
const testName = state.currentTestName || 'unknown';
Expand Down

0 comments on commit dd15459

Please sign in to comment.