Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove some any types #2390

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions features/step_definitions/usage_json_steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { IUsage } from '../../src/formatter/helpers/usage_helpers'

Then('it outputs the usage data:', function (this: World, table: DataTable) {
const usageData: IUsage[] = JSON.parse(this.lastRun.output)
table.hashes().forEach((row: any) => {
table.hashes().forEach((row) => {
const rowUsage = usageData.find(
(datum) =>
datum.pattern === row.PATTERN && datum.patternType === row.PATTERN_TYPE
)
expect(rowUsage).to.be.an('object')
expect(rowUsage.line).to.eql(parseInt(row.LINE))
expect(rowUsage.matches).to.have.lengthOf(row['NUMBER OF MATCHES'])
expect(rowUsage.matches).to.have.lengthOf(Number(row['NUMBER OF MATCHES']))
expect(rowUsage.uri).to.eql(path.normalize(row.URI))
})
})
2 changes: 1 addition & 1 deletion features/support/formatter_output_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function normalizeMessageOutput(
export function stripMetaMessages(
envelopeObjects: messages.Envelope[]
): messages.Envelope[] {
return envelopeObjects.filter((e: any) => {
return envelopeObjects.filter((e) => {
// filter off meta objects, almost none of it predictable/useful for testing
return doesNotHaveValue(e.meta)
})
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/test_case_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default class TestCaseRunner {
async invokeStep(
step: messages.PickleStep,
stepDefinition: IDefinition,
hookParameter?: any
hookParameter?: ITestCaseHookParameter
): Promise<messages.TestStepResult> {
return await StepRunner.run({
defaultTimeout: this.supportCodeLibrary.defaultTimeout,
Expand Down
6 changes: 3 additions & 3 deletions src/support_code_library_builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { buildParameterType } from './build_parameter_type'
import { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'

interface IStepDefinitionConfig {
code: any
code: Function
line: number
options: any
keyword: GherkinStepKeyword
Expand All @@ -52,14 +52,14 @@ interface ITestCaseHookDefinitionConfig {
}

interface ITestStepHookDefinitionConfig {
code: any
code: Function
line: number
options: any
uri: string
}

interface ITestRunHookDefinitionConfig {
code: any
code: Function
line: number
options: any
uri: string
Expand Down
2 changes: 1 addition & 1 deletion src/types/knuth-shuffle-seeded/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
declare module 'knuth-shuffle-seeded' {
export default function shuffle(inputArray: any[], seed?: any): any
export default function shuffle<T>(inputArray: T[], seed?: string): T[]
}