Create shortcut for BaseService-related imports (#2809)
Continue to implement #2698: - Add `core/base-service/index.js` (but hold off on moving the things it imports) - Add shortcuts in `services/index.js` for Base*Service, errors, and deprecatedService. This file will be streamlined later to avoid cluttering it with rarely used bits. - Apply consistent ordering of imports and use of `module.exports` in testers. - Remove some renaming of imports. - Remove obsolete tests here and there.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const BaseJsonService = require('../base-json')
|
||||
const { NotFound } = require('../errors')
|
||||
const { BaseJsonService, NotFound } = require('..')
|
||||
|
||||
const latestBuildSchema = Joi.object({
|
||||
count: Joi.number().required(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const BaseSvgService = require('../base-svg-scraping')
|
||||
const { NotFound } = require('../errors')
|
||||
const { NotFound } = require('..')
|
||||
const { keywords, fetch } = require('./azure-devops-helpers')
|
||||
const { renderBuildStatusBadge } = require('../../lib/build-status')
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const { isBuildStatus } = require('../../lib/build-status')
|
||||
// https://dev.azure.com/totodem/Shields.io is a public Azure DevOps project
|
||||
// solely created for Shields.io testing.
|
||||
|
||||
const t = (module.exports = require('../create-service-tester')())
|
||||
const t = (module.exports = require('..').createServiceTester())
|
||||
|
||||
t.create('default branch')
|
||||
.get(
|
||||
|
||||
@@ -53,7 +53,7 @@ const secondLinesCovStat = {
|
||||
const expCoverageSingleReport = '83%'
|
||||
const expCoverageMultipleReports = '77%'
|
||||
|
||||
const t = (module.exports = require('../create-service-tester')())
|
||||
const t = (module.exports = require('..').createServiceTester())
|
||||
|
||||
t.create('default branch coverage')
|
||||
.get(`${uriPrefix}/${linuxDefinitionId}.json`)
|
||||
|
||||
@@ -6,7 +6,7 @@ const { isBuildStatus } = require('../../lib/build-status')
|
||||
// https://dev.azure.com/totodem/Shields.io is a public Azure DevOps project
|
||||
// solely created for Shields.io testing.
|
||||
|
||||
const t = (module.exports = require('../create-service-tester')())
|
||||
const t = (module.exports = require('..').createServiceTester())
|
||||
|
||||
t.create('release status is succeeded')
|
||||
.get(
|
||||
|
||||
@@ -113,7 +113,7 @@ const isCompactCustomAzureDevOpsTestTotals = isAzureDevOpsTestTotals(
|
||||
true
|
||||
)
|
||||
|
||||
const t = (module.exports = require('../create-service-tester')())
|
||||
const t = (module.exports = require('..').createServiceTester())
|
||||
|
||||
t.create('unknown build definition')
|
||||
.get(`${uriPrefix}/${nonExistentDefinitionId}.json`)
|
||||
|
||||
Reference in New Issue
Block a user