-
Notifications
You must be signed in to change notification settings - Fork 144
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
✅ display the jasmine seed after executing tests #620
Conversation
f2381bb
to
73be192
Compare
Codecov Report
@@ Coverage Diff @@
## master #620 +/- ##
==========================================
- Coverage 89.13% 88.77% -0.36%
==========================================
Files 54 54
Lines 2503 2503
Branches 541 541
==========================================
- Hits 2231 2222 -9
- Misses 272 281 +9
Continue to review full report at Codecov.
|
const log = logger.create('jasmine-seed-reporter') | ||
this.onBrowserComplete = function(browser, result) { | ||
if (result.order && result.order.random && result.order.seed) { | ||
log.info(`${browser}: Randomized with seed ${result.order.seed}\n`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way better to display browser for browser stack tests seed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Motivation
Jasmine tests execution order is random. This can be useful to spot issues that occurs because of tests side effects, but sometimes it makes issues hard to reproduce.
Changes
Display the seed used to execute tests, so they can be re-executed in the same order by using the jasmine
seed
optionInspired from https://github.com/ketan/karma-jasmine-seed-reporter and https://gist.github.com/odlp/e1586f4f198d157de50e8303b18acfd9/ , but for some reason when using
baseReporterDecorator(this);
in the reporter (so it can usethis.write
),console.log()
displays the same message twice. Using a karma "logger" instead ofthis.write
fix the issue.Testing
I have gone over the contributing documentation.