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

✅ display the jasmine seed after executing tests #620

Merged
merged 3 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dev,karma-chrome-launcher,MIT,Copyright 2011-2013 Google Inc.
dev,karma-coverage-istanbul-reporter,MIT,Copyright 2017 Matt Lewis
dev,karma-jasmine,MIT,Copyright 2011-2013 Google Inc.
dev,karma-junit-reporter,MIT,Copyright (C) 2011-2013 Google, Inc.
dev,karma-jasmine-seed-reporter,MIT,Copyright 2018 ThoughtWorks, Inc.
dev,karma-spec-reporter,MIT,Copyright 2015 Michael Lex
dev,karma-sourcemap-loader,MIT,Copyright 2013 Sergey Todyshev
dev,karma-webpack,MIT,Copyright JS Foundation and other contributors
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "2.1.1",
"karma-jasmine": "3.1.1",
"karma-jasmine-seed-reporter": "0.2.0",
"karma-junit-reporter": "2.0.1",
"karma-sourcemap-loader": "0.3.8",
"karma-spec-reporter": "0.0.32",
Expand Down
14 changes: 14 additions & 0 deletions test/unit/jasmineSeedReporterPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function seedReporter(logger) {
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`)
Copy link
Contributor

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!

}
}
}

seedReporter.$inject = ['logger']

module.exports = {
'reporter:jasmine-seed': ['type', seedReporter],
}
5 changes: 3 additions & 2 deletions test/unit/karma.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const webpack = require('webpack')
const webpackConfig = require('../../webpack.base')('development')
const getTestReportDirectory = require('../getTestReportDirectory')
const jasmineSeedReporterPlugin = require('./jasmineSeedReporterPlugin')

const reporters = ['spec']
const reporters = ['spec', 'jasmine-seed']

const testReportDirectory = getTestReportDirectory()
if (testReportDirectory) {
Expand Down Expand Up @@ -48,5 +49,5 @@ module.exports = {
stats: 'errors-only',
logLevel: 'warn',
},
plugins: ['karma-*'],
plugins: ['karma-*', jasmineSeedReporterPlugin],
}
2 changes: 1 addition & 1 deletion test/unit/karma.bs.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function(config) {
config.set({
...karmaBaseConf,
plugins: [...karmaBaseConf.plugins, 'karma-browserstack-launcher'],
reporters: [...karmaBaseConf.reporters, 'BrowserStack', 'jasmine-seed'],
reporters: [...karmaBaseConf.reporters, 'BrowserStack'],
browsers: Object.keys(browsers),
concurrency: 5,
hostname: getIp(),
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5606,11 +5606,6 @@ karma-coverage-istanbul-reporter@2.1.1:
istanbul-api "^2.1.6"
minimatch "^3.0.4"

karma-jasmine-seed-reporter@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/karma-jasmine-seed-reporter/-/karma-jasmine-seed-reporter-0.2.0.tgz#a8f7d4c66d23d756deb63cb8dac88e0e058958b9"
integrity sha512-15d6kNFakKfqNnCNQoRzJpivwbaAjaEdOBfBf4lojLUyLDRkSKhFEujL/kPI4eqM4XtYzHGpuxh3M+MSTBQBjA==

karma-jasmine@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-3.1.1.tgz#f592b253e7619a8d84559d7daf473a647498ade8"
Expand Down