Skip to content

Commit 58b6609

Browse files
committed
chore: remove todos
1 parent 55cbde5 commit 58b6609

File tree

11 files changed

+30
-20
lines changed

11 files changed

+30
-20
lines changed

__tests__/respect/local-json-server/local-json-server.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// expect(result).toMatchSnapshot();
1111
// });
1212

13-
1413
test('local-json-server test case', () => {
1514
//TODO: Remove.Disable this test until json-server is added to the e2e flow.
1615
expect(true).toBe(true);

packages/respect-core/src/handlers/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function handleRun(argv: any) {
5858
logger.printNewLine();
5959

6060
if (testsRunProblemsStatus.some((problems) => problems)) {
61-
exitWithErrorMsg(' Tests exited with error ', 1); // todo check this
61+
exitWithErrorMsg(' Tests exited with error ', 1);
6262
}
6363
} catch (err) {
6464
exitWithErrorMsg((err as Error)?.message ?? err, 1);

packages/respect-core/src/modules/config-parser/parse-request-body.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const getRequestBodyMultipartFormData = async (
6161
payload: RequestBody['payload'],
6262
formData: FormData
6363
) => {
64-
// TODO: handle other than object payload type
6564
if (payload && typeof payload === 'object' && !Array.isArray(payload)) {
6665
const promises: Promise<void>[] = [];
6766
appendObjectToFormData(promises, formData, payload);

packages/respect-core/src/modules/description-parser/get-operation-by-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function getOperationById(
5050
} else {
5151
if (operationDetails.operationId === operationId) {
5252
return {
53-
servers: (pathDetails as any).servers || rootServers, // TODO: fix typings
53+
servers: (pathDetails as any).servers || rootServers,
5454
...operationDetails,
5555
pathParameters: operationDetails.parameters || [],
5656
path,

packages/respect-core/src/modules/flow-runner/call-api-and-analyze-results.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ import { evaluateRuntimeExpressionPayload } from '../runtime-expressions';
66

77
import type { RequestData } from './prepare-request';
88
import type { TestContext, Step } from '../../types';
9+
import type { OperationDetails } from '../description-parser';
10+
import type { ParameterWithIn } from '../config-parser';
11+
12+
// TODO: rename
13+
export type ResultObject = {
14+
ctx: TestContext;
15+
workflowName: string;
16+
step: Step;
17+
requestData: {
18+
serverUrl?: {
19+
url: string;
20+
// TODO: support variables
21+
};
22+
path: string;
23+
method: string;
24+
parameters: ParameterWithIn[];
25+
requestBody: any;
26+
openapiOperation?: OperationDetails & Record<string, string>;
27+
};
28+
};
929

1030
// TODO: split into two functions
1131
export async function callAPIAndAnalyzeResults({

packages/respect-core/src/modules/flow-runner/context/create-test-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function createTestContext(
6060
const ctx: TestContext = {
6161
$response: undefined,
6262
$request: undefined,
63-
$inputs: { env: {} }, // todo: check me?
63+
$inputs: { env: {} },
6464
$faker: faker,
6565
$sourceDescriptions: bundledDescriptions,
6666
$workflows: getPublicWorkflows({

packages/respect-core/src/modules/flow-runner/runner.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ts-ignore
21
import { blue, green } from 'colorette';
32
import { basename, dirname, resolve } from 'node:path';
43
import { writeFileSync } from 'node:fs';
@@ -143,7 +142,6 @@ export async function runWorkflow({
143142

144143
const workflowName = workflow?.workflowId || parentWorkflowId;
145144

146-
// TODO: pass logger
147145
if (parentWorkflowId && parentStepId) {
148146
printStepWorkflowSeparator(parentStepId, parentWorkflowId);
149147
} else if (parentWorkflowId) {

packages/respect-core/src/modules/flow-runner/schema/schema-checker.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import Ajv, { type JSONSchemaType } from '@redocly/ajv/dist/2020';
22
import { diffLinesUnified } from 'jest-diff';
33
import { blue, dim, red, yellow } from 'colorette';
4-
5-
import type { Check, DescriptionChecks, StepCallContext, TestContext } from '../../../types';
6-
4+
import { type Check, type DescriptionChecks, type StepCallContext, type TestContext } from '../../../types';
75
import { CHECKS } from '../../checks';
86
import { printErrors as printAjvErrors } from '../../../utils/ajv-errors';
97
import { checkCircularRefsInSchema } from '../../../utils/check-circular-refs-in-schema';
@@ -21,7 +19,7 @@ const ajvStrict = new Ajv({
2119
validateSchema: false,
2220
discriminator: true,
2321
allowUnionTypes: true,
24-
validateFormats: false, // TODO: fix it
22+
validateFormats: false,
2523
logger: false,
2624
verbose: true,
2725
defaultUnevaluatedProperties: false,
@@ -123,7 +121,6 @@ function checkStatusCodeFromDescription({
123121
const message = matchesCodeFromDescription
124122
? dim(`List of valid response codes are inferred from description \n\n`) +
125123
diffLinesUnified(
126-
// [`Expected one code from those: ${responseCodesFromDescription.join(', ')}`], // TODO: decide on output style
127124
responseCodesFromDescription.map(String),
128125
[`${responseStatusCode}`]
129126
)

packages/respect-core/src/utils/cli-outputs.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { pluralize } from 'jest-matcher-utils';
22
import { red, yellow, bold, blue } from 'colorette';
3-
4-
import type { Totals } from '@redocly/openapi-core';
5-
import type { Check, VerboseLog } from '../types';
6-
3+
import { type Totals } from '@redocly/openapi-core';
4+
import { type Check, type VerboseLog } from '../types';
75
import { displayChecks } from '../modules/cli-output';
86
import { DefaultLogger } from './logger/logger';
97

108
const logger = DefaultLogger.getInstance();
9+
1110
export const RESET_ESCAPE_CODE = '\x1B[0m';
1211

1312
export function removeExtraIndentation(message: string | undefined): string {

packages/respect-core/src/utils/har-logs/helpers/handle-request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ function handleNodeRequest(request: Request, handler: any, harLog?: Map<string,
163163
method: request.method || 'GET',
164164
url: request.url,
165165
httpVersion: 'HTTP/1.1',
166-
cookies: [], // TODO: Parse cookies from headers
166+
cookies: [],
167167
headers: formatUndiciHeaders(request.headers as any),
168-
queryString: [], // TODO: Parse query params
168+
queryString: [],
169169
headersSize: -1,
170170
bodySize: -1,
171171
},

0 commit comments

Comments
 (0)