feat: Loggable decorator for piped functions
loggable attaches additional metadata to helper functions for the .pipe Command. This includes ensuring the display name of a function regardless of the function being anonymous and also attaches parameters passed.
Example:
const getProp = loggable('getProp', prop => obj => obj[prop]
cy.wrap({ foo: 'bar' })
.pipe(getProp('foo'))
.should('equal', 'bar')This will show the following in the the Cypress Command Log:
WRAP {foo: bar}
- PIPE getProp("foo")
- ASSERT expected bar to equal bar
Without using loggable, the PIPE line would not include arguments passed to getProp:
- PIPE getProp
Fixes #16