Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions constants.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import chalk from 'chalk';
import fs from 'fs';
import path from 'path';
import { pathToFileURL } from 'url';
import { pathToFileURL, fileURLToPath } from 'url';
import dotenv from 'dotenv';

dotenv.config();
// Since __dirname is not available in ES modules, we need to derive it
const __filename = new URL(import.meta.url).pathname;
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Function to find the project root directory
Expand Down
2 changes: 2 additions & 0 deletions constants.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
ALL_TEAM_NAMES,
} from './constants.js';

// Most test using the globally set mockConfigDetails will fail because on constants.js,
// shadowConfigDetails is encapsulated and not set as a global object
describe('Constants', () => {
const originalEnv = process.env;
const mockConfigDetails = {
Expand Down