Skip to content

Commit

Permalink
fix: replaceEsm typings
Browse files Browse the repository at this point in the history
Currently:

```ts
// `subscriptions` is `void`
const subscriptions = await td.replaceEsm(
      '../../subscriptions.js',
);
```

Now:

```ts
// `subscriptions` is `{ [namedExport: string]: any; default?: any; }`
const subscriptions = await td.replaceEsm(
      '../../subscriptions.js',
);
```
  • Loading branch information
quinnturner committed Nov 14, 2022
1 parent 7c96564 commit 2b24cff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ export function replace(obj: {}, property: string): TestDouble<any>;
* @param {*} [defaultExportStub]
* @returns {Promise<{default?: any, [namedExport: string]: any}>}
*/
export function replaceEsm(path: string, namedExportStubs?: any, defaultExportStub?: any): Promise<void>;
export function replaceEsm(path: string): Promise<{default?: any, [namedExport: string]: any}>;
export function replaceEsm(path: string, namedExportStubs?: any, defaultExportStub?: any): Promise<void>;

/**
* Swap out real dependencies with fake one. Reference to the property will
Expand Down

0 comments on commit 2b24cff

Please sign in to comment.