Skip to content

Commit

Permalink
publish the injectUpload method (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev authored Apr 7, 2023
1 parent 47cde7d commit 0053213
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Session from './session';
import ResponseMock from './request-pipeline/request-hooks/response-mock';
import RequestFilterRule from './request-pipeline/request-hooks/request-filter-rule';
import UploadStorage from './upload/storage';
import { inject } from './upload/index';
import { processScript, isScriptProcessed } from './processing/script';
import ConfigureResponseEventOptions from './request-pipeline/request-hooks/events/configure-response-event-options';
import StateSnapshot from './session/state-snapshot';
Expand Down Expand Up @@ -57,6 +58,7 @@ export default {
parseProxyUrl,
sameOriginCheck,
injectResources: PageProcessor.injectResources,
injectUpload: inject,
INJECTABLE_SCRIPTS: SCRIPTS,
acceptCrossOrigin,
getAssetPath,
Expand Down
3 changes: 3 additions & 0 deletions ts-defs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,9 @@ declare module 'testcafe-hammerhead' {
/** Inject specified stuff to the page **/
export function injectResources (html: string, resources: PageInjectableResources, options?: PageRestoreStoragesOptions): string;

/** Prepare form post data **/
export function injectUpload (contentTypeHeader: string|void, body: Buffer): Buffer | null;

/** Proxy injectable scripts **/
export const INJECTABLE_SCRIPTS: string[];

Expand Down

0 comments on commit 0053213

Please sign in to comment.