Skip to content

Commit

Permalink
undid config globalSetup
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded committed Nov 16, 2023
1 parent f19044d commit 0937884
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
13 changes: 0 additions & 13 deletions packages/cli/src/cmds/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ import {
runNetworkOnly as legacyRunNetworkOnly,
contextCreator,
} from "../lib/globalContext";
import { fileURLToPath } from "url";

let __dirname;

if (typeof import.meta.url !== "undefined") {
// ESM environment
__dirname = path.dirname(fileURLToPath(import.meta.url));
} else {
// CJS environment
// eslint-disable-next-line no-self-assign
__dirname = __dirname;
}

export const testEffect = (envName: string, additionalArgs?: object) => {
return Effect.gen(function* (_) {
Expand Down Expand Up @@ -166,7 +154,6 @@ export const executeTestEffect = (env: Environment, additionalArgs?: object) =>
const baseOptions = {
watch: false,
globals: true,
setupFiles: [path.join(__dirname, "internal/vitestSetup.js")],
reporters: env.reporters ? env.reporters : ["default"],
outputFile: env.reportFile,
testTimeout: env.timeout || globalConfig.defaultTestTimeout,
Expand Down
6 changes: 0 additions & 6 deletions packages/cli/src/internal/vitestSetup.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/cli/src/lib/configReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ export function isEthereumDevConfig(): boolean {
}

export function importJsonConfig(): MoonwallConfig {
if (globalThis.config) {
return replaceEnvVars(globalThis.config);
}

const configPath = process.env.MOON_CONFIG_PATH!;
const filePath = path.isAbsolute(configPath) ? configPath : path.join(process.cwd(), configPath);

Expand All @@ -87,10 +83,6 @@ export function importJsonConfig(): MoonwallConfig {
}

export async function importAsyncConfig() {
if (globalThis.config) {
return replaceEnvVars(globalThis.config);
}

const configPath = process.env.MOON_CONFIG_PATH!;
const filePath = path.isAbsolute(configPath) ? configPath : path.join(process.cwd(), configPath);

Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/lib/globalContextEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ export class MoonwallContext {

export const createContextEffect = () =>
Effect.gen(function* (_) {
// console.log("globalThis.config", globalThis.config.length);
// console.dir(globalThis.config, { depth: 1 })

const config = yield* _(
Effect.tryPromise({
try: () => importAsyncConfig(),
Expand Down

0 comments on commit 0937884

Please sign in to comment.