-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add logging helper to add arguments passed to functions #16
Comments
NicholasBoll
added a commit
that referenced
this issue
Apr 27, 2019
`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: ```ts 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
NicholasBoll
added a commit
that referenced
this issue
Apr 27, 2019
`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: ```ts 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
NicholasBoll
added a commit
that referenced
this issue
Apr 27, 2019
`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: ```ts 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
NicholasBoll
added a commit
that referenced
this issue
Apr 27, 2019
`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: ```ts 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
NicholasBoll
added a commit
that referenced
this issue
May 2, 2019
`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: ```ts 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pipe
is useful to tell us what functions are passed to pipe, but if those functions take parameters, those arguments are completely invisible.Example:
Log shows:
It should show:
It isn't possible for pipe through arguments, but a helper function could help out. Something like:
The text was updated successfully, but these errors were encountered: