forked from ryanmwangi/CalMerger
test(calendar.test.js):Ensure the test merged calendars directory exists
This commit is contained in:
parent
b7a419f9cb
commit
0fc02c579d
|
@ -11,11 +11,13 @@ let server;
|
||||||
|
|
||||||
describe('Calendar Merging API', () => {
|
describe('Calendar Merging API', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
// Set environment variable for the test directory
|
||||||
|
process.env.TEST_MERGED_CALENDARS_DIR = TEST_MERGED_CALENDARS_DIR;
|
||||||
// Start the server
|
// Start the server
|
||||||
server = app.listen(0);
|
server = app.listen(0);
|
||||||
// Ensure the merged calendars directory exists
|
// Ensure the test merged calendars directory exists
|
||||||
if (!fs.existsSync(MERGED_CALENDARS_DIR)) {
|
if (!fs.existsSync(TEST_MERGED_CALENDARS_DIR)) {
|
||||||
fs.mkdirSync(MERGED_CALENDARS_DIR);
|
fs.mkdirSync(TEST_MERGED_CALENDARS_DIR, { recursive: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue