1
0
mirror of https://github.com/badges/shields.git synced 2025-12-01 18:37:54 +03:00

Refactor checkShouldSkip, affects [Twitch SymfonyInsight Wheelmap] (#4807)

This commit is contained in:
Pierre-Yves B
2020-04-02 21:03:22 +02:00
committed by GitHub
parent 52cea58f8a
commit 8ef54f6f38
7 changed files with 42 additions and 52 deletions

View File

@@ -1,7 +1,5 @@
'use strict'
const runnerConfig = require('config').util.toObject()
const sampleProjectUuid = '45afb680-d4e6-4e66-93ea-bcfa79eb8a87'
function createMockResponse({ status = 'finished', grade, violations }) {
@@ -88,17 +86,9 @@ const config = {
},
}
function checkShouldSkip() {
const noToken =
!runnerConfig.private.sl_insight_userUuid ||
!runnerConfig.private.sl_insight_apiToken
if (noToken) {
console.warn(
'No Symfony credentials configured. Service tests will be skipped. Add credentials in local.yml to run these tests.'
)
}
return noToken
}
const { noToken } = require('../test-helpers')
const { SymfonyInsightBase } = require('./symfony-insight-base')
const noSymfonyToken = noToken(SymfonyInsightBase)
module.exports = {
sampleProjectUuid,
@@ -117,5 +107,5 @@ module.exports = {
user,
token,
config,
checkShouldSkip,
noSymfonyToken,
}