Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjchmiela committed Oct 11, 2024
1 parent 56a7534 commit 637b0a7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions packages/steps/src/__tests__/BuildStepContext-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os from 'os';

import { BuildStaticContext } from '@expo/eas-build-job';
import { JobInterpolationContext } from '@expo/eas-build-job';
import { instance, mock, when } from 'ts-mockito';

import { BuildStep } from '../BuildStep.js';
Expand All @@ -23,7 +23,7 @@ describe(BuildStepGlobalContext, () => {
'/another/non/existent/path',
'/working/dir/path',
'/non/existent/path',
{} as unknown as BuildStaticContext
{} as unknown as JobInterpolationContext
),
false
);
Expand All @@ -42,7 +42,7 @@ describe(BuildStepGlobalContext, () => {
projectTargetDirectory,
workingDirectory,
'/non/existent/path',
{} as unknown as BuildStaticContext
{} as unknown as JobInterpolationContext
),
false
);
Expand All @@ -60,7 +60,7 @@ describe(BuildStepGlobalContext, () => {
projectTargetDirectory,
workingDirectory,
'/non/existent/path',
{} as unknown as BuildStaticContext
{} as unknown as JobInterpolationContext
),
false
);
Expand All @@ -82,7 +82,7 @@ describe(BuildStepGlobalContext, () => {
projectSourceDirectory: '/a/b/c',
projectTargetDirectory: '/d/e/f',
relativeWorkingDirectory: 'i',
staticContextContent: { a: 1 } as unknown as BuildStaticContext,
staticContextContent: { a: 1 } as unknown as JobInterpolationContext,
});
expect(ctx.serialize()).toEqual(
expect.objectContaining({
Expand Down Expand Up @@ -114,7 +114,7 @@ describe(BuildStepGlobalContext, () => {
defaultWorkingDirectory: '/g/h/i',
buildLogsDirectory: '/j/k/l',
runtimePlatform: BuildRuntimePlatform.DARWIN,
staticContext: { a: 1 } as unknown as BuildStaticContext,
staticContext: { a: 1 } as unknown as JobInterpolationContext,
env: {},
},
skipCleanup: true,
Expand Down
22 changes: 11 additions & 11 deletions packages/steps/src/__tests__/BuildStepInput-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BuildStaticContext } from '@expo/eas-build-job';
import { JobInterpolationContext } from '@expo/eas-build-job';

import { BuildStepRuntimeError } from '../errors.js';
import { BuildStep } from '../BuildStep.js';
Expand Down Expand Up @@ -126,7 +126,7 @@ describe(BuildStepInput, () => {
foo: {
bar: 'Line 1\nLine 2\n\nLine 3',
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput(ctx, {
id: 'foo',
Expand All @@ -144,7 +144,7 @@ describe(BuildStepInput, () => {
foo: {
bar: 'Line 1\\nLine 2\\n\\nLine 3',
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput(ctx, {
id: 'foo',
Expand All @@ -169,7 +169,7 @@ describe(BuildStepInput, () => {
},
],
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput<BuildStepInputValueTypeName>(ctx, {
id: 'foo',
Expand All @@ -196,7 +196,7 @@ describe(BuildStepInput, () => {
},
],
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput<BuildStepInputValueTypeName>(ctx, {
id: 'foo',
Expand All @@ -223,7 +223,7 @@ describe(BuildStepInput, () => {
},
],
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput<BuildStepInputValueTypeName>(ctx, {
id: 'foo',
Expand All @@ -250,7 +250,7 @@ describe(BuildStepInput, () => {
},
],
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput<BuildStepInputValueTypeName>(ctx, {
id: 'foo',
Expand Down Expand Up @@ -279,7 +279,7 @@ describe(BuildStepInput, () => {
},
],
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput<BuildStepInputValueTypeName>(ctx, {
id: 'foo',
Expand Down Expand Up @@ -308,7 +308,7 @@ describe(BuildStepInput, () => {
},
],
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput<BuildStepInputValueTypeName>(ctx, {
id: 'foo',
Expand All @@ -329,7 +329,7 @@ describe(BuildStepInput, () => {
context_val_2: {
in_val_1: 'in_val_1',
},
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput(ctx, {
id: 'foo',
Expand Down Expand Up @@ -361,7 +361,7 @@ describe(BuildStepInput, () => {
const ctx = createGlobalContextMock({
staticContextContent: {
context_val_1: 'Line 1\nLine 2\n\nLine 3',
} as unknown as BuildStaticContext,
} as unknown as JobInterpolationContext,
});
const i = new BuildStepInput(ctx, {
id: 'foo',
Expand Down
10 changes: 5 additions & 5 deletions packages/steps/src/__tests__/utils/context.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os from 'os';
import path from 'path';

import { BuildStaticContext } from '@expo/eas-build-job';
import { JobInterpolationContext } from '@expo/eas-build-job';
import { bunyan } from '@expo/logger';
import { v4 as uuidv4 } from 'uuid';

Expand All @@ -25,12 +25,12 @@ export class MockContextProvider implements ExternalBuildContextProvider {
public readonly projectTargetDirectory: string,
public readonly defaultWorkingDirectory: string,
public readonly buildLogsDirectory: string,
public readonly staticContextContent: BuildStaticContext
public readonly staticContextContent: JobInterpolationContext
) {}
public get env(): BuildStepEnv {
return this._env;
}
public staticContext(): BuildStaticContext {
public staticContext(): JobInterpolationContext {
return { ...this.staticContextContent };
}
public updateEnv(env: BuildStepEnv): void {
Expand All @@ -46,7 +46,7 @@ interface BuildContextParams {
projectSourceDirectory?: string;
projectTargetDirectory?: string;
relativeWorkingDirectory?: string;
staticContextContent?: BuildStaticContext;
staticContextContent?: JobInterpolationContext;
}

export function createStepContextMock({
Expand Down Expand Up @@ -96,7 +96,7 @@ export function createGlobalContextMock({
? path.resolve(resolvedProjectTargetDirectory, relativeWorkingDirectory)
: resolvedProjectTargetDirectory,
'/non/existent/dir',
staticContextContent ?? ({} as BuildStaticContext)
staticContextContent ?? ({} as JobInterpolationContext)
),
skipCleanup ?? false
);
Expand Down
4 changes: 2 additions & 2 deletions packages/steps/src/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import { BuildStaticContext, Env, Job, Metadata } from '@expo/eas-build-job';
import { Env, Job, JobInterpolationContext, Metadata } from '@expo/eas-build-job';
import { bunyan, createLogger } from '@expo/logger';

import { BuildConfigParser } from '../BuildConfigParser.js';
Expand Down Expand Up @@ -28,7 +28,7 @@ export class CliContextProvider implements ExternalBuildContextProvider {
public get env(): BuildStepEnv {
return this._env;
}
public staticContext(): BuildStaticContext {
public staticContext(): JobInterpolationContext {
return {
job: {} as Job,
metadata: {} as Metadata,
Expand Down

0 comments on commit 637b0a7

Please sign in to comment.