Skip to content

Commit

Permalink
Update testing.d.ts
Browse files Browse the repository at this point in the history
Add `Stubscape` export to testing.d.ts and align documentation with
corresponding testing.js code.
  • Loading branch information
ericcornelissen committed Dec 7, 2023
1 parent 87dd76e commit 2742c8a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions testing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,30 @@ import type { Shescape as ShescapeType } from "shescape";
export const injectionStrings: string[];

/**
* A test stub of shescape that has the same input-output profile as the real
* shescape implementation.
* An optimistic test stub of Shescape that has the same input-output profile as
* the real Shescape implementation.
*
* In particular:
* - The constructor never fails.
* - Returns a string for all stringable inputs.
* - Errors on non-stringable inputs.
* - Converts non-array inputs to single-item arrays where necessary.
* - Errors on non-array inputs where arrays are expected.
* - Errors when trying to quote when `shell: false`.
*/
export const Stubscape: ShescapeType;

/**
* An optimistic test stub of Shescape that has the same input-output profile as
* the real Shescape implementation.
*
* In particular:
* - The constructor never fails.
* - Returns a string for all stringable inputs.
* - Errors on non-stringable inputs.
* - Errors on non-array inputs where arrays are expected.
* - Errors when trying to quote when `shell: false`.
*
* @alias Stubscape
*/
export const Shescape: ShescapeType;

Expand Down

0 comments on commit 2742c8a

Please sign in to comment.