mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 21:53:24 +02:00
Fix all res/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
var chalk = require('chalk')
|
||||
/* eslint no-console:0 */
|
||||
|
||||
// http://stackoverflow.com/questions/7157999/output-jasmine-test-results-to-the-console
|
||||
// https://github.com/pivotal/jasmine/blob/master/src/console/ConsoleReporter.js
|
||||
|
||||
module.exports = function BrowserLogs(options) {
|
||||
options = options || {}
|
||||
module.exports = function BrowserLogs(opts) {
|
||||
var options = opts || {}
|
||||
|
||||
if (typeof options.expectNoLogs === 'undefined') {
|
||||
options.expectNoLogs = false
|
||||
@@ -13,17 +14,17 @@ module.exports = function BrowserLogs(options) {
|
||||
options.outputLogs = true
|
||||
}
|
||||
|
||||
browser.getCapabilities().then(function (cap) {
|
||||
browser.getCapabilities().then(function(cap) {
|
||||
var browserName = ' ' + cap.caps_.browserName + ' log '
|
||||
var browserStyled = chalk.bgBlue.white.bold(browserName) + ' '
|
||||
|
||||
browser.manage().logs().get('browser').then(function (browserLogs) {
|
||||
browser.manage().logs().get('browser').then(function(browserLogs) {
|
||||
if (options.expectNoLogs) {
|
||||
expect(browserLogs.length).toEqual(0)
|
||||
}
|
||||
|
||||
if (options.outputLogs && browserLogs.length) {
|
||||
browserLogs.forEach(function (log) {
|
||||
browserLogs.forEach(function(log) {
|
||||
if (log.level.value > 900) {
|
||||
console.error(browserStyled + chalk.white.bold(log.message))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user