From 408a9296fa451948d8ae95d55563be8662f9dda4 Mon Sep 17 00:00:00 2001 From: jkdowdle Date: Tue, 12 Feb 2019 14:49:31 -0700 Subject: [PATCH] fix(log): show regexp values in the cypress command log (#35) * Add support for RegExp values to show up in the Cypress Command Log. * Update all contributors. --- .all-contributorsrc | 9 +++++++++ README.md | 4 ++-- src/index.js | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8a37770..1c12ee8 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -100,6 +100,15 @@ "contributions": [ "doc" ] + }, + { + "login": "jkdowdle", + "name": "jkdowdle", + "avatar_url": "https://avatars0.githubusercontent.com/u/19804196?v=4", + "profile": "https://github.com/jkdowdle", + "contributions": [ + "code" + ] } ], "repoType": "github" diff --git a/README.md b/README.md index 1a3496f..c25692d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ [![downloads][downloads-badge]][npmtrends] [![MIT License][license-badge]][license] -[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] @@ -118,7 +118,7 @@ Thanks goes to these people ([emoji key][emojis]): | [
Kent C. Dodds](https://kentcdodds.com)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=kentcdodds "Code") [📖](https://github.com/kentcdodds/cypress-testing-library/commits?author=kentcdodds "Documentation") [🚇](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=kentcdodds "Tests") | [
Ivan Babak](https://sompylasar.github.io)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=sompylasar "Code") [🤔](#ideas-sompylasar "Ideas, Planning, & Feedback") | [
Łukasz Gandecki](http://team.thebrain.pro)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=lgandecki "Code") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=lgandecki "Tests") | [
Peter Kamps](https://github.com/npeterkamps)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=npeterkamps "Code") [📖](https://github.com/kentcdodds/cypress-testing-library/commits?author=npeterkamps "Documentation") [🤔](#ideas-npeterkamps "Ideas, Planning, & Feedback") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=npeterkamps "Tests") | [
Airat Aminev](https://github.com/airato)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=airato "Code") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=airato "Tests") [🔧](#tool-airato "Tools") | [
Adrian Smijulj](https://www.webiny.com)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=adrian1358 "Code") | [
Soo Jae Hwang](https://www.ossfinder.com)
[🐛](https://github.com/kentcdodds/cypress-testing-library/issues?q=author%3Amisoguy "Bug reports") [💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=misoguy "Code") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=misoguy "Tests") | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| [
Justin Hall](https://github.com/wKovacs64)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=wKovacs64 "Code") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=wKovacs64 "Tests") | [
euzebe](https://github.com/euZebe)
[📖](https://github.com/kentcdodds/cypress-testing-library/commits?author=euZebe "Documentation") | +| [
Justin Hall](https://github.com/wKovacs64)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=wKovacs64 "Code") [⚠️](https://github.com/kentcdodds/cypress-testing-library/commits?author=wKovacs64 "Tests") | [
euzebe](https://github.com/euZebe)
[📖](https://github.com/kentcdodds/cypress-testing-library/commits?author=euZebe "Documentation") | [
jkdowdle](https://github.com/jkdowdle)
[💻](https://github.com/kentcdodds/cypress-testing-library/commits?author=jkdowdle "Code") | diff --git a/src/index.js b/src/index.js index 789ab2a..1c103ea 100644 --- a/src/index.js +++ b/src/index.js @@ -59,6 +59,9 @@ const commands = Object.keys(queries).map(queryName => { if (Array.isArray(value) && value.length === 0) { return false } + if (value instanceof RegExp) { + return value.toString() + } if ( typeof value === 'object' && Object.keys(value).length === 0