Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin): accept the RegExp | string union type in the patterns #175

Conversation

derevnjuk
Copy link
Member

@derevnjuk derevnjuk commented Jan 25, 2023

It is now possible to utilize regular expressions rather than strings when specifying the excludePaths or includeHosts options.

Before:

cy.recordHar({ excludePaths: ['^\\/api\\/products$', '^\\/api\\/users$'] });

After:

cy.recordHar({ excludePaths: [/^\/api\/products$/, '^\\/api\\/users$'] });

closes #171

It is now possible to utilize regular expressions rather than strings when specifying the excludePaths or includeHosts options.

**Before**:

```ts
cy.recordHar({ excludePaths: ['^\\/api\\/products$', '^\\/api\\/users$'] });
```

**After**:

```ts
cy.recordHar({ excludePaths: [/^\/api\/products$/, '^\\/api\\/users$'] });
```

closes #163
@derevnjuk derevnjuk added the Type: enhancement New feature or request. label Jan 25, 2023
@derevnjuk derevnjuk self-assigned this Jan 25, 2023
@codeclimate
Copy link

codeclimate bot commented Jan 25, 2023

Code Climate has analyzed commit e545cbe and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 69.2% (50% is the threshold).

This pull request will bring the total coverage in the repository to 92.1%.

View more on Code Climate.

@derevnjuk derevnjuk merged commit 2e0160e into master Jan 25, 2023
@derevnjuk derevnjuk deleted the feat_#171/accept_RegExp_and_string_union_type_in_the_patterns branch January 25, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept RegExp and string union type in the patterns
1 participant