Skip to content

Commit

Permalink
fix(types): CustomLocator typing broken for custom strict locators (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored Jan 10, 2024
1 parent 9a05c17 commit 17e0919
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ declare namespace CodeceptJS {
* }
* }
* ```
*/
*/
helpers?: {
/**
* Run web tests controlling browsers via Playwright engine.
Expand Down Expand Up @@ -289,7 +289,7 @@ declare namespace CodeceptJS {
* ```js
* bootstrap: 'bootstrap.js',
* ```
*/
*/
bootstrap?: (() => Promise<void>) | boolean | string;
/**
* [Execute code after tests](https://codecept.io/bootstrap/) finished.
Expand All @@ -303,7 +303,7 @@ declare namespace CodeceptJS {
* ```js
* teardown: 'teardown.js',
* ```
*/
*/
teardown?: (() => Promise<void>) | boolean | string;
/**
* [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
Expand All @@ -312,7 +312,7 @@ declare namespace CodeceptJS {
bootstrapAll?: (() => Promise<void>) | boolean | string;
/**
* [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
*/
*/
teardownAll?: (() => Promise<void>) | boolean | string;

/** Enable [localized test commands](https://codecept.io/translation/) */
Expand All @@ -328,7 +328,7 @@ declare namespace CodeceptJS {
* ```
* require: ["should"]
* ```
*/
*/
require?: Array<string>;

/**
Expand Down Expand Up @@ -423,15 +423,18 @@ declare namespace CodeceptJS {
| { ios: string }
| { android: string; ios: string }
| { react: string }
| { vue: string }
| { shadow: string[] }
| { custom: string };

interface CustomLocators {}
interface OtherLocators { props?: object }
type LocatorOrString =
| string
| ILocator
| Locator
| CustomLocators;
| OtherLocators
| CustomLocators[keyof CustomLocators];

type StringOrSecret = string | CodeceptJS.Secret;

Expand Down

0 comments on commit 17e0919

Please sign in to comment.