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

getCurrentTestName shows wrong description #6

Closed
erwindemoel opened this issue Feb 11, 2020 · 3 comments · Fixed by #10
Closed

getCurrentTestName shows wrong description #6

erwindemoel opened this issue Feb 11, 2020 · 3 comments · Fixed by #10
Assignees
Labels
enhancement New feature or request

Comments

@erwindemoel
Copy link

erwindemoel commented Feb 11, 2020

Hi, I tried to implement your solution because we want to console.log the name of each running test within the fit(''). Here is my example code:

fit('testing my description', () => { console.log(JasmineSmacker.getCurrentTestName()); });

After following your steps, I do get a console.log with the name of one of our tests, however it is the wrong one. It logs the name of another test instead of the current one. How can I fix this so it logs the correct one?

@Jezorko
Copy link
Owner

Jezorko commented Aug 11, 2020

Hey @erwindemoel, thanks for reporting this!
I've pushed a fix and will merge once the CI finishes (:
#10

@Jezorko
Copy link
Owner

Jezorko commented Aug 11, 2020

The change is here:

[
{testMethodToEnhance: it, setter: (newValue) => it = newValue},
{testMethodToEnhance: fit, setter: (newValue) => fit = newValue}
]

To get this thing working, I am globally replacing the it function. Now both it and fit are replaced.

@Jezorko Jezorko self-assigned this Aug 11, 2020
@Jezorko Jezorko added the enhancement New feature or request label Aug 11, 2020
@Jezorko
Copy link
Owner

Jezorko commented Aug 11, 2020

Also I see that the discussion under the issue has been updated with a much nicer solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants