Skip to content

Commit

Permalink
rename method and add to module entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgoss committed Dec 29, 2024
1 parent a11b454 commit 4067245
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
5 changes: 2 additions & 3 deletions src/api/load_configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {
parseConfiguration,
validateConfiguration,
} from '../configuration'
import { mergeEnvironment } from '../environment/merge_environment'
import { IRunEnvironment } from '../environment'
import { IRunEnvironment, makeEnvironment } from '../environment'
import { convertConfiguration } from './convert_configuration'
import { IResolvedConfiguration, ILoadConfigurationOptions } from './types'

Expand All @@ -22,7 +21,7 @@ export async function loadConfiguration(
options: ILoadConfigurationOptions = {},
environment: IRunEnvironment = {}
): Promise<IResolvedConfiguration> {
const { cwd, env, logger } = mergeEnvironment(environment)
const { cwd, env, logger } = makeEnvironment(environment)
const configFile = options.file ?? locateFile(cwd)
if (configFile) {
logger.debug(`Configuration will be loaded from "${configFile}"`)
Expand Down
5 changes: 2 additions & 3 deletions src/api/load_sources.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { IdGenerator } from '@cucumber/messages'
import { resolvePaths } from '../paths'
import { mergeEnvironment } from '../environment/merge_environment'
import { IRunEnvironment } from '../environment'
import { IRunEnvironment, makeEnvironment } from '../environment'
import {
ILoadSourcesResult,
IPlannedPickle,
Expand All @@ -23,7 +22,7 @@ export async function loadSources(
coordinates: ISourcesCoordinates,
environment: IRunEnvironment = {}
): Promise<ILoadSourcesResult> {
const mergedEnvironment = mergeEnvironment(environment)
const mergedEnvironment = makeEnvironment(environment)
const { cwd, logger } = mergedEnvironment
const newId = IdGenerator.uuid()
const pluginManager = await initializeForLoadSources(
Expand Down
5 changes: 2 additions & 3 deletions src/api/load_support.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { IdGenerator } from '@cucumber/messages'
import { resolvePaths } from '../paths'
import { mergeEnvironment } from '../environment/merge_environment'
import { IRunEnvironment } from '../environment'
import { IRunEnvironment, makeEnvironment } from '../environment'
import { ILoadSupportOptions, ISupportCodeLibrary } from './types'
import { getSupportCodeLibrary } from './support'
import { initializeForLoadSupport } from './plugins'
Expand All @@ -17,7 +16,7 @@ export async function loadSupport(
options: ILoadSupportOptions,
environment: IRunEnvironment = {}
): Promise<ISupportCodeLibrary> {
const mergedEnvironment = mergeEnvironment(environment)
const mergedEnvironment = makeEnvironment(environment)
const { cwd, logger } = mergedEnvironment
const newId = IdGenerator.uuid()
const supportCoordinates = Object.assign(
Expand Down
5 changes: 2 additions & 3 deletions src/api/run_cucumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { SupportCodeLibrary } from '../support_code_library_builder/types'
import { version } from '../version'
import { IFilterablePickle } from '../filter'
import { makeRuntime } from '../runtime'
import { mergeEnvironment } from '../environment/merge_environment'
import { IRunEnvironment } from '../environment'
import { IRunEnvironment, makeEnvironment } from '../environment'
import { IRunOptions, IRunResult } from './types'
import { initializeFormatters } from './formatters'
import { getSupportCodeLibrary } from './support'
Expand All @@ -28,7 +27,7 @@ export async function runCucumber(
environment: IRunEnvironment = {},
onMessage?: (message: Envelope) => void
): Promise<IRunResult> {
const mergedEnvironment = mergeEnvironment(environment)
const mergedEnvironment = makeEnvironment(environment)
const { cwd, stdout, stderr, env, logger } = mergedEnvironment

logger.debug(`Running cucumber-js ${version}
Expand Down
1 change: 1 addition & 0 deletions src/environment/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './make_environment'
export * from './types'
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConsoleLogger } from './console_logger'
import { UsableEnvironment, IRunEnvironment } from './types'

export function mergeEnvironment(provided: IRunEnvironment): UsableEnvironment {
export function makeEnvironment(provided: IRunEnvironment): UsableEnvironment {
const fullEnvironment = Object.assign(
{},
{
Expand Down

0 comments on commit 4067245

Please sign in to comment.