From 8a8311d931b9949ae9fdff72c96abb60019825da Mon Sep 17 00:00:00 2001 From: Paul Melnikow Date: Sat, 8 Dec 2018 13:15:24 -0500 Subject: [PATCH] Unify and minimize tester boilerplate (#2472) I started using this one-line boilerplate a while back and it seems to tidy things up a bit. --- doc/service-tests.md | 10 +++------- services/amo/amo.tester.js | 6 ++++-- services/ansible/ansible.tester.js | 6 ++++-- services/apm/apm.tester.js | 7 +++++-- services/appveyor/appveyor-ci.tester.js | 5 +---- services/appveyor/appveyor-tests.tester.js | 4 +--- services/aur/aur.tester.js | 6 ++++-- services/azure-devops/azure-devops-build.tester.js | 4 ++-- services/azure-devops/azure-devops-coverage.tester.js | 4 ++-- services/azure-devops/azure-devops-release.tester.js | 4 ++-- services/azure-devops/azure-devops-tests.tester.js | 4 ++-- services/beerpay/beerpay.tester.js | 5 ++--- services/bintray/bintray.tester.js | 3 +-- services/bitbucket/bitbucket.tester.js | 6 ++++-- services/bithound/bithound.tester.js | 6 ++++-- services/bitrise/bitrise.tester.js | 6 ++++-- services/bountysource/bountysource.tester.js | 6 ++++-- services/bower/bower.tester.js | 3 +-- services/bugzilla/bugzilla.tester.js | 6 ++++-- services/buildkite/buildkite.tester.js | 7 +++++-- services/bundlephobia/bundlephobia.tester.js | 6 ++---- services/cauditor/cauditor.tester.js | 6 ++++-- services/cdnjs/cdnjs.tester.js | 4 +--- services/chocolatey/chocolatey.tester.js | 6 ++++-- services/chrome-web-store/chrome-web-store.tester.js | 5 ++--- services/circleci/circleci.tester.js | 6 ++++-- services/clojars/clojars-downloads.tester.js | 4 +--- services/clojars/clojars-version.tester.js | 4 +--- services/cocoapods/cocoapods.tester.js | 6 ++++-- services/codacy/codacy-coverage.tester.js | 3 +-- services/codacy/codacy-grade.tester.js | 3 +-- services/codeclimate/codeclimate.tester.js | 7 ++++--- services/codecov/codecov.tester.js | 6 ++++-- services/codeship/codeship.tester.js | 6 ++++-- services/codetally/codetally.tester.js | 6 ++++-- services/conda/conda.tester.js | 3 +-- services/continuousphp/continuousphp.tester.js | 4 +--- services/cookbook/cookbook.tester.js | 5 +---- services/coveralls/coveralls.tester.js | 6 ++++-- services/cpan/cpan-license.tester.js | 4 +--- services/cran/cran.tester.js | 6 ++++-- services/crates/crates-downloads.tester.js | 5 ++--- services/crates/crates-license.tester.js | 5 ++--- services/crates/crates-version.tester.js | 5 ++--- services/ctan/ctan.tester.js | 5 ++--- services/david/david.tester.js | 4 ++-- services/dependabot/dependabot.tester.js | 6 ++++-- services/depfu/depfu.tester.js | 3 +-- services/discord/discord.tester.js | 6 ++++-- services/discourse/discourse.tester.js | 6 ++++-- services/dockbit/dockbit.tester.js | 6 ++++-- services/docker/docker-automated.tester.js | 4 +--- services/docker/docker-build.tester.js | 4 +--- services/docker/docker-pulls.tester.js | 4 +--- services/docker/docker-stars.tester.js | 4 +--- services/dotnetstatus/dotnetstatus.tester.js | 6 ++++-- services/dub/dub.tester.js | 6 ++---- services/dynamic/dynamic-json.tester.js | 3 +-- services/dynamic/dynamic-xml.tester.js | 5 ++--- services/dynamic/dynamic-yaml.tester.js | 5 ++--- .../eclipse-marketplace-downloads.tester.js | 6 ++---- .../eclipse-marketplace-favorites.tester.js | 5 ++--- .../eclipse-marketplace-license.tester.js | 5 ++--- .../eclipse-marketplace-update.tester.js | 6 ++---- .../eclipse-marketplace-version.tester.js | 6 ++---- services/elm-package/elm-package.tester.js | 3 +-- services/f-droid/f-droid.tester.js | 11 +++++++---- services/flip/flip.tester.js | 3 +-- services/gem/gem-downloads.tester.js | 5 +---- services/gem/gem-owner.tester.js | 4 +--- services/gem/gem-rank.tester.js | 4 +--- services/gem/gem-version.tester.js | 5 +---- services/gemnasium/gemnasium.tester.js | 6 ++++-- .../github/github-pull-request-check-state.tester.js | 3 +-- services/github/github.tester.js | 11 +++++++---- services/gitlab/gitlab-pipeline-status.tester.js | 3 +-- services/gitter/gitter.tester.js | 5 +---- services/gratipay/gratipay.tester.js | 6 ++++-- services/hackage/hackage.tester.js | 7 ++++--- services/hexpm/hexpm.tester.js | 3 +-- services/homebrew/homebrew.tester.js | 6 ++++-- services/imagelayers/imagelayers.tester.js | 6 ++++-- services/jenkins/jenkins-plugin-installs.tester.js | 3 +-- services/leanpub/leanpub-book-summary.tester.js | 4 ++-- .../librariesio/librariesio-dependent-repos.tester.js | 4 +--- services/librariesio/librariesio-dependents.tester.js | 4 +--- services/librariesio/librariesio-sourcerank.tester.js | 4 +--- services/nexus/nexus.tester.js | 3 +-- services/node/node.tester.js | 4 +--- services/npm/npm-license.tester.js | 4 +--- services/npm/npm-type-definitions.tester.js | 6 ++---- services/npm/npm-version.tester.js | 4 +--- services/readthedocs/readthedocs.tester.js | 4 +--- services/requires/requires.tester.js | 4 +--- services/shippable/shippable.tester.js | 4 +--- .../stackexchange-monthlyquestions.tester.js | 4 ++-- .../stackexchange/stackexchange-reputation.tester.js | 4 ++-- .../stackexchange/stackexchange-taginfo.tester.js | 4 ++-- services/static-badge/static-badge.tester.js | 3 +-- services/swagger/swagger.tester.js | 4 ++-- services/uptimerobot/uptimerobot-ratio.tester.js | 5 +---- services/uptimerobot/uptimerobot-status.tester.js | 6 ++---- services/wercker/wercker.tester.js | 4 +--- 103 files changed, 236 insertions(+), 275 deletions(-) diff --git a/doc/service-tests.md b/doc/service-tests.md index 8b5c8c1577d76..2fc797e0dbb57 100644 --- a/doc/service-tests.md +++ b/doc/service-tests.md @@ -38,17 +38,13 @@ We'll start by adding some boilerplate to our file: ```js 'use strict' -const Joi = require('joi') // 1 +const Joi = require('joi') // 1 -const createServiceTester = require('../create-service-tester') // 2 -const t = createServiceTester() // 2 - -module.exports = t // 3 +const t = (module.exports = require('../create-service-tester')()) // 2 ``` 1. Import [Joi][] We'll use this to make assertions. This is the same library we use to define schema for validation in the main badge class. -2. If our `.service.js` module exports a single class, we can `require('../create-service-tester')` and use convention to create a `ServiceTester` object. Calling `createServiceTester()` inside `services/wercker/wercker.tester.js` will create a `ServiceTester` object configured for the service exported in `services/wercker/wercker.service.js`. We will add our tests to this `ServiceTester` object `t`. -3. `t` is exported from the module. +2. If our `.service.js` module exports a single class, we can `require('../create-service-tester')` and use convention to create a `ServiceTester` object. Calling this inside `services/wercker/wercker.tester.js` will create a `ServiceTester` object configured for the service exported in `services/wercker/wercker.service.js`. We will add our tests to this `ServiceTester` object `t`, which is exported from the module. ### (2) Our First Test Case diff --git a/services/amo/amo.tester.js b/services/amo/amo.tester.js index b789210a01782..5e5d0eb4d2649 100644 --- a/services/amo/amo.tester.js +++ b/services/amo/amo.tester.js @@ -8,8 +8,10 @@ const { isVPlusDottedVersionAtLeastOne, } = require('../test-validators') -const t = new ServiceTester({ id: 'amo', title: 'Mozilla Addons' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'amo', + title: 'Mozilla Addons', +})) t.create('Downloads') .get('/d/IndieGala-Helper.json') diff --git a/services/ansible/ansible.tester.js b/services/ansible/ansible.tester.js index 8b52d36c54277..4abc539351de2 100644 --- a/services/ansible/ansible.tester.js +++ b/services/ansible/ansible.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isMetric } = require('../test-validators') -const t = new ServiceTester({ id: 'ansible', title: 'Ansible Galaxy' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'ansible', + title: 'Ansible Galaxy', +})) t.create('role name (valid)') .get('/role/14542.json') diff --git a/services/apm/apm.tester.js b/services/apm/apm.tester.js index 779a204e5fb21..9e659f87888e1 100644 --- a/services/apm/apm.tester.js +++ b/services/apm/apm.tester.js @@ -2,10 +2,13 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'apm', title: 'Atom Package Manager' }) const { invalidJSON } = require('../response-fixtures') const { isMetric, isVPlusTripleDottedVersion } = require('../test-validators') -module.exports = t + +const t = (module.exports = new ServiceTester({ + id: 'apm', + title: 'Atom Package Manager', +})) t.create('Downloads') .get('/dm/vim-mode.json') diff --git a/services/appveyor/appveyor-ci.tester.js b/services/appveyor/appveyor-ci.tester.js index a88c9dffabaa3..b559cdbd94ccb 100644 --- a/services/appveyor/appveyor-ci.tester.js +++ b/services/appveyor/appveyor-ci.tester.js @@ -1,12 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') - const { isBuildStatus } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('CI status') .get('/gruntjs/grunt.json') diff --git a/services/appveyor/appveyor-tests.tester.js b/services/appveyor/appveyor-tests.tester.js index 66307ec784b89..6a97febc2d40e 100644 --- a/services/appveyor/appveyor-tests.tester.js +++ b/services/appveyor/appveyor-tests.tester.js @@ -1,7 +1,6 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const isAppveyorTestTotals = Joi.string().regex( /^(?:[0-9]+ (?:passed|skipped|failed)(?:, )?)+$/ @@ -19,8 +18,7 @@ const isCompactCustomAppveyorTestTotals = Joi.string().regex( /^(?:[0-9]* ?(?:💃|🤦‍♀️|🤷) ?[0-9]*(?:, | \| )?)+$/ ) -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Test status') .get('/NZSmartie/coap-net-iu0to.json') diff --git a/services/aur/aur.tester.js b/services/aur/aur.tester.js index 3164e3977f41d..64f98c9294228 100644 --- a/services/aur/aur.tester.js +++ b/services/aur/aur.tester.js @@ -7,8 +7,10 @@ const { isMetric, } = require('../test-validators') -const t = new ServiceTester({ id: 'aur', title: 'Arch Linux AUR' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'aur', + title: 'Arch Linux AUR', +})) // version tests diff --git a/services/azure-devops/azure-devops-build.tester.js b/services/azure-devops/azure-devops-build.tester.js index 30bc89c33bf91..80d7e557080fd 100644 --- a/services/azure-devops/azure-devops-build.tester.js +++ b/services/azure-devops/azure-devops-build.tester.js @@ -2,12 +2,12 @@ const Joi = require('joi') const { isBuildStatus } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t // 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')()) + t.create('default branch') .get( '/azure-devops/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2.json' diff --git a/services/azure-devops/azure-devops-coverage.tester.js b/services/azure-devops/azure-devops-coverage.tester.js index a86b2bd9e2b22..fd17777f4d6bc 100644 --- a/services/azure-devops/azure-devops-coverage.tester.js +++ b/services/azure-devops/azure-devops-coverage.tester.js @@ -2,8 +2,6 @@ const Joi = require('joi') const { isIntegerPercentage } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t const org = 'swellaby' const project = 'opensource' @@ -55,6 +53,8 @@ const secondLinesCovStat = { const expCoverageSingleReport = '83%' const expCoverageMultipleReports = '77%' +const t = (module.exports = require('../create-service-tester')()) + t.create('default branch coverage') .get(`${uriPrefix}/${linuxDefinitionId}.json`) .expectJSONTypes( diff --git a/services/azure-devops/azure-devops-release.tester.js b/services/azure-devops/azure-devops-release.tester.js index b55aae55e6f7a..05e46b4862b07 100644 --- a/services/azure-devops/azure-devops-release.tester.js +++ b/services/azure-devops/azure-devops-release.tester.js @@ -2,12 +2,12 @@ const Joi = require('joi') const { isBuildStatus } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t // 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')()) + t.create('release status is succeeded') .get( '/azure-devops/release/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/1/1.json' diff --git a/services/azure-devops/azure-devops-tests.tester.js b/services/azure-devops/azure-devops-tests.tester.js index 48cee13a09bae..1ea8c5c7a95cc 100644 --- a/services/azure-devops/azure-devops-tests.tester.js +++ b/services/azure-devops/azure-devops-tests.tester.js @@ -1,8 +1,6 @@ 'use strict' const Joi = require('joi') -const t = require('../create-service-tester')() -module.exports = t const org = 'azuredevops-powershell' const project = 'azuredevops-powershell' @@ -115,6 +113,8 @@ const isCompactCustomAzureDevOpsTestTotals = isAzureDevOpsTestTotals( true ) +const t = (module.exports = require('../create-service-tester')()) + t.create('unknown build definition') .get(`${uriPrefix}/${nonExistentDefinitionId}.json`) .expectJSON({ name: 'tests', value: 'build pipeline not found' }) diff --git a/services/beerpay/beerpay.tester.js b/services/beerpay/beerpay.tester.js index dcaa73434b908..6632a1b2a6813 100644 --- a/services/beerpay/beerpay.tester.js +++ b/services/beerpay/beerpay.tester.js @@ -3,11 +3,10 @@ const Joi = require('joi') const { withRegex } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t - const amountOfMoney = withRegex(/^\$[0-9]+(\.[0-9]+)?/) +const t = (module.exports = require('../create-service-tester')()) + t.create('funding') .get('/hashdog/scrapfy-chrome-extension.json') .expectJSONTypes( diff --git a/services/bintray/bintray.tester.js b/services/bintray/bintray.tester.js index 91b7eb0adb542..d0abf9b532596 100644 --- a/services/bintray/bintray.tester.js +++ b/services/bintray/bintray.tester.js @@ -6,8 +6,7 @@ const { isVPlusDottedVersionNClausesWithOptionalSuffix, } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('version') .get('/asciidoctor/maven/asciidoctorj.json') diff --git a/services/bitbucket/bitbucket.tester.js b/services/bitbucket/bitbucket.tester.js index f3d31687386e4..bab6d0a0e00a2 100644 --- a/services/bitbucket/bitbucket.tester.js +++ b/services/bitbucket/bitbucket.tester.js @@ -8,8 +8,10 @@ const { isMetricOpenIssues, } = require('../test-validators') -const t = new ServiceTester({ id: 'bitbucket', title: 'Bitbucket badges' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'bitbucket', + title: 'Bitbucket badges', +})) // tests for issues endpoints diff --git a/services/bithound/bithound.tester.js b/services/bithound/bithound.tester.js index 13510764d2ae0..e4f65895f3da6 100644 --- a/services/bithound/bithound.tester.js +++ b/services/bithound/bithound.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'bithound', title: 'BitHound' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'bithound', + title: 'BitHound', +})) t.create('no longer available (code)') .get('/code/github/rexxars/sse-channel.json') diff --git a/services/bitrise/bitrise.tester.js b/services/bitrise/bitrise.tester.js index e688630f808c1..86fad8afb7b2f 100644 --- a/services/bitrise/bitrise.tester.js +++ b/services/bitrise/bitrise.tester.js @@ -3,8 +3,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'bitrise', title: 'Bitrise' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'bitrise', + title: 'Bitrise', +})) t.create('deploy status') .get('/cde737473028420d/master.json?token=GCIdEzacE4GW32jLVrZb7A') diff --git a/services/bountysource/bountysource.tester.js b/services/bountysource/bountysource.tester.js index af0b651a91333..74665fbe88609 100644 --- a/services/bountysource/bountysource.tester.js +++ b/services/bountysource/bountysource.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { invalidJSON } = require('../response-fixtures') -const t = new ServiceTester({ id: 'bountysource', title: 'Bountysource' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'bountysource', + title: 'Bountysource', +})) t.create('bounties (valid)') .get('/team/mozilla-core/activity.json') diff --git a/services/bower/bower.tester.js b/services/bower/bower.tester.js index dc668e23a5f57..997d3c4365403 100644 --- a/services/bower/bower.tester.js +++ b/services/bower/bower.tester.js @@ -8,8 +8,7 @@ const isBowerPrereleaseVersion = Joi.string().regex( /^v\d+(\.\d+)?(\.\d+)?(-?[.\w\d])+?$/ ) -const t = new ServiceTester({ id: 'bower', title: 'Bower' }) -module.exports = t +const t = (module.exports = new ServiceTester({ id: 'bower', title: 'Bower' })) t.create('licence') .get('/l/bootstrap.json') diff --git a/services/bugzilla/bugzilla.tester.js b/services/bugzilla/bugzilla.tester.js index 547ffd0a34c3f..e746612920f3f 100644 --- a/services/bugzilla/bugzilla.tester.js +++ b/services/bugzilla/bugzilla.tester.js @@ -15,8 +15,10 @@ const bzBugStatus = Joi.equal( 'incomplete' ) -const t = new ServiceTester({ id: 'bugzilla', title: 'Bugzilla' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'bugzilla', + title: 'Bugzilla', +})) t.create('Bugzilla valid bug status') .get('/996038.json') diff --git a/services/buildkite/buildkite.tester.js b/services/buildkite/buildkite.tester.js index fbc64881b06bc..082c593d4134f 100644 --- a/services/buildkite/buildkite.tester.js +++ b/services/buildkite/buildkite.tester.js @@ -2,10 +2,13 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'buildkite', title: 'Buildkite Builds' }) const { invalidJSON } = require('../response-fixtures') const { isBuildStatus } = require('../test-validators') -module.exports = t + +const t = (module.exports = new ServiceTester({ + id: 'buildkite', + title: 'Buildkite Builds', +})) t.create('buildkite invalid pipeline') .get('/unknown-identifier/unknown-branch.json') diff --git a/services/bundlephobia/bundlephobia.tester.js b/services/bundlephobia/bundlephobia.tester.js index 91332e70cd5fc..4a519e93950b3 100644 --- a/services/bundlephobia/bundlephobia.tester.js +++ b/services/bundlephobia/bundlephobia.tester.js @@ -4,12 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isFileSize } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'bundlephobia', title: 'NPM package bundle size', -}) - -module.exports = t +})) const formats = { A: '/bundlephobia/:type/:package.:format', diff --git a/services/cauditor/cauditor.tester.js b/services/cauditor/cauditor.tester.js index 84f7bf6d5594f..1b8553d511d88 100644 --- a/services/cauditor/cauditor.tester.js +++ b/services/cauditor/cauditor.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'cauditor', title: 'Cauditor' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'cauditor', + title: 'Cauditor', +})) t.create('no longer available') .get('/mi/matthiasmullie/scrapbook/master.json?style=_shields_test') diff --git a/services/cdnjs/cdnjs.tester.js b/services/cdnjs/cdnjs.tester.js index b5b1196bb99c5..b79a697e80927 100644 --- a/services/cdnjs/cdnjs.tester.js +++ b/services/cdnjs/cdnjs.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isVPlusTripleDottedVersion } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('cdnjs (valid)') .get('/jquery.json') diff --git a/services/chocolatey/chocolatey.tester.js b/services/chocolatey/chocolatey.tester.js index b4086cb36d383..d0d49418a6e09 100644 --- a/services/chocolatey/chocolatey.tester.js +++ b/services/chocolatey/chocolatey.tester.js @@ -15,8 +15,10 @@ const { } = require('../nuget-fixtures') const { invalidJSON } = require('../response-fixtures') -const t = new ServiceTester({ id: 'chocolatey', title: 'Chocolatey' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'chocolatey', + title: 'Chocolatey', +})) // downloads diff --git a/services/chrome-web-store/chrome-web-store.tester.js b/services/chrome-web-store/chrome-web-store.tester.js index 12053a48c4132..e7a5888b5b3c4 100644 --- a/services/chrome-web-store/chrome-web-store.tester.js +++ b/services/chrome-web-store/chrome-web-store.tester.js @@ -9,11 +9,10 @@ const { isMetric, } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'chrome-web-store', title: 'Chrome Web Store', -}) -module.exports = t +})) t.create('Downloads (now users)') .get('/d/alhjnofcnnpeaphgeakdhkebafjcpeae.json') diff --git a/services/circleci/circleci.tester.js b/services/circleci/circleci.tester.js index 7d3aef403f853..d1480802e7ac8 100644 --- a/services/circleci/circleci.tester.js +++ b/services/circleci/circleci.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isBuildStatus } = require('../test-validators') -const t = new ServiceTester({ id: 'circleci', title: 'Circle CI' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'circleci', + title: 'Circle CI', +})) t.create('circle ci (valid, without branch)') .get('/project/github/RedSparr0w/node-csgo-parser.json') diff --git a/services/clojars/clojars-downloads.tester.js b/services/clojars/clojars-downloads.tester.js index 45e3338e68695..f1d83cbe73453 100644 --- a/services/clojars/clojars-downloads.tester.js +++ b/services/clojars/clojars-downloads.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isMetric } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('clojars downloads (valid)') .get('/prismic.json') diff --git a/services/clojars/clojars-version.tester.js b/services/clojars/clojars-version.tester.js index 5abe4d5ad1c7e..f21d558e01ad4 100644 --- a/services/clojars/clojars-version.tester.js +++ b/services/clojars/clojars-version.tester.js @@ -1,10 +1,8 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('clojars (valid)') .get('/prismic.json') diff --git a/services/cocoapods/cocoapods.tester.js b/services/cocoapods/cocoapods.tester.js index 143e422f3b16f..272e66b7114df 100644 --- a/services/cocoapods/cocoapods.tester.js +++ b/services/cocoapods/cocoapods.tester.js @@ -19,8 +19,10 @@ const isMetricOverTimePeriodAllowZero = Joi.string().regex( ) const isMetricAllowZero = Joi.string().regex(/^(0|[1-9][0-9]*)[kMGTPEZY]?$/) -const t = new ServiceTester({ id: 'cocoapods', title: 'Cocoa Pods' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'cocoapods', + title: 'Cocoa Pods', +})) // version endpoint diff --git a/services/codacy/codacy-coverage.tester.js b/services/codacy/codacy-coverage.tester.js index b7fa182d3030c..c42405a667155 100644 --- a/services/codacy/codacy-coverage.tester.js +++ b/services/codacy/codacy-coverage.tester.js @@ -3,8 +3,7 @@ const Joi = require('joi') const { isIntegerPercentage } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Coverage') .get('/59d607d0e311408885e418004068ea58.json') diff --git a/services/codacy/codacy-grade.tester.js b/services/codacy/codacy-grade.tester.js index 1344d66937df8..49af7da4b8700 100644 --- a/services/codacy/codacy-grade.tester.js +++ b/services/codacy/codacy-grade.tester.js @@ -3,8 +3,7 @@ const Joi = require('joi') const { codacyGrade } = require('./codacy-helpers') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Code quality') .get('/grade/e27821fb6289410b8f58338c7e0bc686.json') diff --git a/services/codeclimate/codeclimate.tester.js b/services/codeclimate/codeclimate.tester.js index 02f907c47a8de..46302d41a35bf 100644 --- a/services/codeclimate/codeclimate.tester.js +++ b/services/codeclimate/codeclimate.tester.js @@ -4,7 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isIntegerPercentage } = require('../test-validators') -const t = new ServiceTester({ id: 'codeclimate', title: 'Code Climate' }) +const t = (module.exports = new ServiceTester({ + id: 'codeclimate', + title: 'Code Climate', +})) // Tests based on Code Climate's test reports endpoint. t.create('test coverage percentage') @@ -136,5 +139,3 @@ t.create('malformed response for inner specific repo query') name: 'maintainability', value: 'invalid', }) - -module.exports = t diff --git a/services/codecov/codecov.tester.js b/services/codecov/codecov.tester.js index 5f5b72f713bc9..7fdd5b23c9a2d 100644 --- a/services/codecov/codecov.tester.js +++ b/services/codecov/codecov.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isIntegerPercentage } = require('../test-validators') -const t = new ServiceTester({ id: 'codecov', title: 'Codecov.io' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'codecov', + title: 'Codecov.io', +})) t.create('gets coverage status') .get('/c/github/codecov/example-python.json') diff --git a/services/codeship/codeship.tester.js b/services/codeship/codeship.tester.js index 70adb3ce5110e..3f25410a8a235 100644 --- a/services/codeship/codeship.tester.js +++ b/services/codeship/codeship.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isBuildStatus } = require('../test-validators') -const t = new ServiceTester({ id: 'codeship', title: 'codeship' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'codeship', + title: 'codeship', +})) t.create('codeship (valid, no branch)') .get('/d6c1ddd0-16a3-0132-5f85-2e35c05e22b1.json') diff --git a/services/codetally/codetally.tester.js b/services/codetally/codetally.tester.js index 40d6d6839b64f..ac2220ffd50de 100644 --- a/services/codetally/codetally.tester.js +++ b/services/codetally/codetally.tester.js @@ -3,8 +3,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'codetally', title: 'Codetally' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'codetally', + title: 'Codetally', +})) // This test will extract the currency value from the // string value response from the server. diff --git a/services/conda/conda.tester.js b/services/conda/conda.tester.js index b97741b256cfd..f3039fcb6347d 100644 --- a/services/conda/conda.tester.js +++ b/services/conda/conda.tester.js @@ -6,8 +6,7 @@ const { isVPlusTripleDottedVersion, isMetric } = require('../test-validators') const isCondaPlatform = Joi.string().regex(/^\w+-\d+( \| \w+-\d+)*$/) -const t = new ServiceTester({ id: 'conda', title: 'Conda' }) -module.exports = t +const t = (module.exports = new ServiceTester({ id: 'conda', title: 'Conda' })) t.create('version') .get('/v/conda-forge/zlib.json') diff --git a/services/continuousphp/continuousphp.tester.js b/services/continuousphp/continuousphp.tester.js index 1590d83c4dbe2..bb47a66e062d3 100644 --- a/services/continuousphp/continuousphp.tester.js +++ b/services/continuousphp/continuousphp.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isBuildStatus } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('build status on default branch') .get('/git-hub/doctrine/dbal.json') diff --git a/services/cookbook/cookbook.tester.js b/services/cookbook/cookbook.tester.js index 24ea2149c5993..08ebe479149e4 100644 --- a/services/cookbook/cookbook.tester.js +++ b/services/cookbook/cookbook.tester.js @@ -1,13 +1,10 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { colorScheme } = require('../test-helpers') const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') -const t = createServiceTester() - -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('version') .get('/chef-sugar.json') diff --git a/services/coveralls/coveralls.tester.js b/services/coveralls/coveralls.tester.js index 87a08f3219686..a6805b1cb9a6d 100644 --- a/services/coveralls/coveralls.tester.js +++ b/services/coveralls/coveralls.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isIntegerPercentage } = require('../test-validators') -const t = new ServiceTester({ id: 'coveralls', title: 'Coveralls.io' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'coveralls', + title: 'Coveralls.io', +})) t.create('error status code - location header is missing') .get('/github/not/existed.json') diff --git a/services/cpan/cpan-license.tester.js b/services/cpan/cpan-license.tester.js index eb2f21331a692..e340756f90a57 100644 --- a/services/cpan/cpan-license.tester.js +++ b/services/cpan/cpan-license.tester.js @@ -1,8 +1,6 @@ 'use strict' -const createServiceTester = require('../create-service-tester') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('license') .get('/Config-Augeas.json') diff --git a/services/cran/cran.tester.js b/services/cran/cran.tester.js index 36f5b4ca40f67..57d3979fde263 100644 --- a/services/cran/cran.tester.js +++ b/services/cran/cran.tester.js @@ -4,8 +4,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { isVPlusTripleDottedVersion } = require('../test-validators') -const t = new ServiceTester({ id: 'cran', title: 'CRAN/METACRAN' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'cran', + title: 'CRAN/METACRAN', +})) t.create('version') .get('/v/devtools.json') diff --git a/services/crates/crates-downloads.tester.js b/services/crates/crates-downloads.tester.js index ad83ef561f7f5..42531cd3683ca 100644 --- a/services/crates/crates-downloads.tester.js +++ b/services/crates/crates-downloads.tester.js @@ -3,12 +3,11 @@ const ServiceTester = require('../service-tester') const { isMetric } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'crates', title: 'crates.io', pathPrefix: '/crates', -}) -module.exports = t +})) t.create('total downloads') .get('/d/libc.json') diff --git a/services/crates/crates-license.tester.js b/services/crates/crates-license.tester.js index 2478b87454dee..7b5ba9c5ae7b1 100644 --- a/services/crates/crates-license.tester.js +++ b/services/crates/crates-license.tester.js @@ -2,12 +2,11 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'crates', title: 'crates.io', pathPrefix: '/crates/l', -}) -module.exports = t +})) t.create('license') .get('/libc.json') diff --git a/services/crates/crates-version.tester.js b/services/crates/crates-version.tester.js index 13d257df13a37..e0118a10c85d9 100644 --- a/services/crates/crates-version.tester.js +++ b/services/crates/crates-version.tester.js @@ -3,12 +3,11 @@ const ServiceTester = require('../service-tester') const { isSemver } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'crates', title: 'crates.io', pathPrefix: '/crates/v', -}) -module.exports = t +})) t.create('version') .get('/libc.json') diff --git a/services/ctan/ctan.tester.js b/services/ctan/ctan.tester.js index 649cd24984f49..521b17698b7be 100644 --- a/services/ctan/ctan.tester.js +++ b/services/ctan/ctan.tester.js @@ -5,11 +5,10 @@ const ServiceTester = require('../service-tester') const { colorScheme } = require('../test-helpers') const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'ctan', title: 'Comprehensive TEX Archive Network', -}) -module.exports = t +})) t.create('license') .get('/l/novel.json') diff --git a/services/david/david.tester.js b/services/david/david.tester.js index c3b2d055499c9..a12f45f6215ac 100644 --- a/services/david/david.tester.js +++ b/services/david/david.tester.js @@ -3,14 +3,14 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') const { invalidJSON } = require('../response-fixtures') + const isDependencyStatus = Joi.string().valid( 'insecure', 'up to date', 'out of date' ) -const t = new ServiceTester({ id: 'david', title: 'David' }) -module.exports = t +const t = (module.exports = new ServiceTester({ id: 'david', title: 'David' })) t.create('david dependencies (valid)') .get('/expressjs/express.json') diff --git a/services/dependabot/dependabot.tester.js b/services/dependabot/dependabot.tester.js index b9c4e5375292f..5ebac1a50aee0 100644 --- a/services/dependabot/dependabot.tester.js +++ b/services/dependabot/dependabot.tester.js @@ -6,8 +6,10 @@ const { isIntegerPercentage } = require('../test-validators') const { invalidJSON } = require('../response-fixtures') const { colorScheme: colorsB } = require('../test-helpers') -const t = new ServiceTester({ id: 'dependabot', title: 'Dependabot' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'dependabot', + title: 'Dependabot', +})) t.create('semver stability (valid)') .get('/semver/bundler/puma.json') diff --git a/services/depfu/depfu.tester.js b/services/depfu/depfu.tester.js index d1a7749e90082..57a350bb0c4bf 100644 --- a/services/depfu/depfu.tester.js +++ b/services/depfu/depfu.tester.js @@ -10,8 +10,7 @@ const isDependencyStatus = Joi.string().valid( 'stale' ) -const t = new ServiceTester({ id: 'depfu', title: 'Depfu' }) -module.exports = t +const t = (module.exports = new ServiceTester({ id: 'depfu', title: 'Depfu' })) t.create('depfu dependencies (valid)') .get('/depfu/example-ruby.json') diff --git a/services/discord/discord.tester.js b/services/discord/discord.tester.js index 3da44f6113b58..5c07fbc471d04 100644 --- a/services/discord/discord.tester.js +++ b/services/discord/discord.tester.js @@ -3,8 +3,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'discord', title: 'Discord' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'discord', + title: 'Discord', +})) t.create('gets status for Reactiflux') .get('/102860784329052160.json?style=_shields_test') diff --git a/services/discourse/discourse.tester.js b/services/discourse/discourse.tester.js index 74bca839c0e62..04e894850297e 100644 --- a/services/discourse/discourse.tester.js +++ b/services/discourse/discourse.tester.js @@ -3,8 +3,10 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'discourse', title: 'Discourse' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'discourse', + title: 'Discourse', +})) const data = { topic_count: 22513, diff --git a/services/dockbit/dockbit.tester.js b/services/dockbit/dockbit.tester.js index 8c0ea2cb63648..306a38e7aefb7 100644 --- a/services/dockbit/dockbit.tester.js +++ b/services/dockbit/dockbit.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'dockbit', title: 'Dockbit' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'dockbit', + title: 'Dockbit', +})) t.create('no longer available (previously image size)') .get('/image-size/_/ubuntu/latest.json') diff --git a/services/docker/docker-automated.tester.js b/services/docker/docker-automated.tester.js index 5af46fb430d1c..b528d00905f51 100644 --- a/services/docker/docker-automated.tester.js +++ b/services/docker/docker-automated.tester.js @@ -1,13 +1,11 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { colorScheme: colorsB } = require('../test-helpers') const { dockerBlue } = require('./docker-helpers') const isAutomatedBuildStatus = Joi.string().valid('automated', 'manual') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('docker automated build (valid, library)') .get('/_/ubuntu.json') diff --git a/services/docker/docker-build.tester.js b/services/docker/docker-build.tester.js index df1170bb57259..6c1f3fce76b57 100644 --- a/services/docker/docker-build.tester.js +++ b/services/docker/docker-build.tester.js @@ -1,13 +1,11 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { colorScheme: colorsB } = require('../test-helpers') const { dockerBlue } = require('./docker-helpers') const { isBuildStatus } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('docker build status (valid, user)') .get('/jrottenberg/ffmpeg.json') diff --git a/services/docker/docker-pulls.tester.js b/services/docker/docker-pulls.tester.js index c30f0bd6f4522..12853ea9b7dbd 100644 --- a/services/docker/docker-pulls.tester.js +++ b/services/docker/docker-pulls.tester.js @@ -1,12 +1,10 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { dockerBlue } = require('./docker-helpers') const { isMetric } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('docker pulls (valid, library)') .get('/_/ubuntu.json?style=_shields_test') diff --git a/services/docker/docker-stars.tester.js b/services/docker/docker-stars.tester.js index f137212e6df01..d477476a843a4 100644 --- a/services/docker/docker-stars.tester.js +++ b/services/docker/docker-stars.tester.js @@ -1,12 +1,10 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { dockerBlue } = require('./docker-helpers') const { isMetric } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('docker stars (valid, library)') .get('/_/ubuntu.json?style=_shields_test') diff --git a/services/dotnetstatus/dotnetstatus.tester.js b/services/dotnetstatus/dotnetstatus.tester.js index 66dd1090e242e..fa427f1adb03f 100644 --- a/services/dotnetstatus/dotnetstatus.tester.js +++ b/services/dotnetstatus/dotnetstatus.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'dotnetstatus', title: 'dotnet-status' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'dotnetstatus', + title: 'dotnet-status', +})) t.create('no longer available (previously get package status)') .get('/gh/jaredcnance/dotnet-status/API.json') diff --git a/services/dub/dub.tester.js b/services/dub/dub.tester.js index a1629c230de39..6a8bd962bb591 100644 --- a/services/dub/dub.tester.js +++ b/services/dub/dub.tester.js @@ -2,15 +2,14 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') - const { invalidJSON } = require('../response-fixtures') const { colorScheme } = require('../test-helpers') - const { isVPlusDottedVersionNClausesWithOptionalSuffix, isMetric, isMetricOverTimePeriod, } = require('../test-validators') + const isVersionColor = Joi.equal( colorScheme.red, colorScheme.yellow, @@ -19,8 +18,7 @@ const isVersionColor = Joi.equal( colorScheme.brightgreen ) -const t = new ServiceTester({ id: 'dub', title: 'Dub' }) -module.exports = t +const t = (module.exports = new ServiceTester({ id: 'dub', title: 'Dub' })) // downloads diff --git a/services/dynamic/dynamic-json.tester.js b/services/dynamic/dynamic-json.tester.js index 3c58c38dfef55..03a05f9ff4dd6 100644 --- a/services/dynamic/dynamic-json.tester.js +++ b/services/dynamic/dynamic-json.tester.js @@ -4,8 +4,7 @@ const Joi = require('joi') const { expect } = require('chai') const { colorScheme: colorsB } = require('../test-helpers') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Connection error') .get( diff --git a/services/dynamic/dynamic-xml.tester.js b/services/dynamic/dynamic-xml.tester.js index 70b610fe47e2a..111d86472fae8 100644 --- a/services/dynamic/dynamic-xml.tester.js +++ b/services/dynamic/dynamic-xml.tester.js @@ -6,12 +6,11 @@ const ServiceTester = require('../service-tester') const { isSemver } = require('../test-validators') const { colorScheme: colorsB } = require('../test-helpers') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'dynamic-xml', title: 'User Defined XML Source Data', pathPrefix: '/badge/dynamic/xml', -}) -module.exports = t +})) t.create('Connection error') .get( diff --git a/services/dynamic/dynamic-yaml.tester.js b/services/dynamic/dynamic-yaml.tester.js index dd35452b61270..35b5ce87dae64 100644 --- a/services/dynamic/dynamic-yaml.tester.js +++ b/services/dynamic/dynamic-yaml.tester.js @@ -3,12 +3,11 @@ const ServiceTester = require('../service-tester') const { colorScheme: colorsB } = require('../test-helpers') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'dynamic-yaml', title: 'User Defined YAML Source Data', pathPrefix: '/badge/dynamic/yaml', -}) -module.exports = t +})) t.create('Connection error') .get( diff --git a/services/eclipse-marketplace/eclipse-marketplace-downloads.tester.js b/services/eclipse-marketplace/eclipse-marketplace-downloads.tester.js index 6ec4e7ea9a6c6..33af994b66b09 100644 --- a/services/eclipse-marketplace/eclipse-marketplace-downloads.tester.js +++ b/services/eclipse-marketplace/eclipse-marketplace-downloads.tester.js @@ -2,15 +2,13 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') - const { isMetric, isMetricOverTimePeriod } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'eclipse-marketplace-downloads', title: 'EclipseMarketplaceDownloads', pathPrefix: '/eclipse-marketplace', -}) -module.exports = t +})) t.create('total marketplace downloads') .get('/dt/notepad4e.json') diff --git a/services/eclipse-marketplace/eclipse-marketplace-favorites.tester.js b/services/eclipse-marketplace/eclipse-marketplace-favorites.tester.js index 288872f2b916a..97797caefa2d7 100644 --- a/services/eclipse-marketplace/eclipse-marketplace-favorites.tester.js +++ b/services/eclipse-marketplace/eclipse-marketplace-favorites.tester.js @@ -3,12 +3,11 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'eclipse-marketplace-favorites', title: 'EclipseMarketplaceFavorites', pathPrefix: '/eclipse-marketplace', -}) -module.exports = t +})) t.create('favorites count') .get('/favorites/notepad4e.json') diff --git a/services/eclipse-marketplace/eclipse-marketplace-license.tester.js b/services/eclipse-marketplace/eclipse-marketplace-license.tester.js index 992de8fd27b3b..c8ef96512b7eb 100644 --- a/services/eclipse-marketplace/eclipse-marketplace-license.tester.js +++ b/services/eclipse-marketplace/eclipse-marketplace-license.tester.js @@ -2,12 +2,11 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'eclipse-marketplace-license', title: 'EclipseMarketplaceLicense', pathPrefix: '/eclipse-marketplace', -}) -module.exports = t +})) t.create('license') .get('/l/notepad4e.json') diff --git a/services/eclipse-marketplace/eclipse-marketplace-update.tester.js b/services/eclipse-marketplace/eclipse-marketplace-update.tester.js index fc6d70b1fbb12..2934d45bd1df0 100644 --- a/services/eclipse-marketplace/eclipse-marketplace-update.tester.js +++ b/services/eclipse-marketplace/eclipse-marketplace-update.tester.js @@ -2,15 +2,13 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') - const { isFormattedDate } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'eclipse-marketplace-update', title: 'EclipseMarketplaceUpdate', pathPrefix: '/eclipse-marketplace', -}) -module.exports = t +})) t.create('last update date') .get('/last-update/notepad4e.json') diff --git a/services/eclipse-marketplace/eclipse-marketplace-version.tester.js b/services/eclipse-marketplace/eclipse-marketplace-version.tester.js index 24f5d349ef537..51e6b1ccd8913 100644 --- a/services/eclipse-marketplace/eclipse-marketplace-version.tester.js +++ b/services/eclipse-marketplace/eclipse-marketplace-version.tester.js @@ -2,15 +2,13 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') - const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') -const t = new ServiceTester({ +const t = (module.exports = new ServiceTester({ id: 'eclipse-marketplace-version', title: 'EclipseMarketplaceVersion', pathPrefix: '/eclipse-marketplace', -}) -module.exports = t +})) t.create('marketplace version') .get('/v/notepad4e.json') diff --git a/services/elm-package/elm-package.tester.js b/services/elm-package/elm-package.tester.js index 67da14bb01531..f86fe8aa8461d 100644 --- a/services/elm-package/elm-package.tester.js +++ b/services/elm-package/elm-package.tester.js @@ -3,8 +3,7 @@ const Joi = require('joi') const { isSemver } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('gets the package version of elm/core') .get('/elm/core.json') diff --git a/services/f-droid/f-droid.tester.js b/services/f-droid/f-droid.tester.js index 72670bca4d81a..8ec9d0421700f 100644 --- a/services/f-droid/f-droid.tester.js +++ b/services/f-droid/f-droid.tester.js @@ -1,10 +1,13 @@ 'use strict' -const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') -const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'f-droid', title: 'F-Droid' }) const Joi = require('joi') -module.exports = t +const ServiceTester = require('../service-tester') +const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') + +const t = (module.exports = new ServiceTester({ + id: 'f-droid', + title: 'F-Droid', +})) const testString = ` Categories:System diff --git a/services/flip/flip.tester.js b/services/flip/flip.tester.js index 49250b1c2e0dc..a89d983fe620c 100644 --- a/services/flip/flip.tester.js +++ b/services/flip/flip.tester.js @@ -1,7 +1,6 @@ 'use strict' -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('First request') .get('.json') diff --git a/services/gem/gem-downloads.tester.js b/services/gem/gem-downloads.tester.js index 469df1fe36ef0..0eda4f4df32da 100644 --- a/services/gem/gem-downloads.tester.js +++ b/services/gem/gem-downloads.tester.js @@ -1,12 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') - const { isMetric } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) // total downloads t.create('total downloads (valid)') diff --git a/services/gem/gem-owner.tester.js b/services/gem/gem-owner.tester.js index c3aa6e0b197a9..0ab50b2c5042c 100644 --- a/services/gem/gem-owner.tester.js +++ b/services/gem/gem-owner.tester.js @@ -1,10 +1,8 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('users (valid)') .get('/raphink.json') diff --git a/services/gem/gem-rank.tester.js b/services/gem/gem-rank.tester.js index 0518e4f3ea330..1fcdfc31beedf 100644 --- a/services/gem/gem-rank.tester.js +++ b/services/gem/gem-rank.tester.js @@ -1,15 +1,13 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const isOrdinalNumber = Joi.string().regex(/^[1-9][0-9]+(ᵗʰ|ˢᵗ|ⁿᵈ|ʳᵈ)$/) const isOrdinalNumberDaily = Joi.string().regex( /^[1-9][0-9]+(ᵗʰ|ˢᵗ|ⁿᵈ|ʳᵈ) daily$/ ) -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('total rank (valid)') .get('/rt/rspec-puppet-facts.json') diff --git a/services/gem/gem-version.tester.js b/services/gem/gem-version.tester.js index 67d6944fb2b39..3e07347dcaa85 100644 --- a/services/gem/gem-version.tester.js +++ b/services/gem/gem-version.tester.js @@ -1,12 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') - const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('version (valid)') .get('/formatador.json') diff --git a/services/gemnasium/gemnasium.tester.js b/services/gemnasium/gemnasium.tester.js index 937f4e9f708a9..039042cbb67e3 100644 --- a/services/gemnasium/gemnasium.tester.js +++ b/services/gemnasium/gemnasium.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'gemnasium', title: 'gemnasium' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'gemnasium', + title: 'gemnasium', +})) t.create('no longer available (previously dependencies)') .get('/mathiasbynens/he.json') diff --git a/services/github/github-pull-request-check-state.tester.js b/services/github/github-pull-request-check-state.tester.js index 277d8982d1780..dab1e4b5905aa 100644 --- a/services/github/github-pull-request-check-state.tester.js +++ b/services/github/github-pull-request-check-state.tester.js @@ -1,7 +1,6 @@ 'use strict' -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('github pull request check state') .get('/s/pulls/badges/shields/1110.json') diff --git a/services/github/github.tester.js b/services/github/github.tester.js index dd3921bdb020c..8edf342d69c19 100644 --- a/services/github/github.tester.js +++ b/services/github/github.tester.js @@ -1,6 +1,8 @@ 'use strict' const Joi = require('joi') +const { licenseToColor } = require('../../lib/licenses') +const { makeColor } = require('../../lib/badge-data') const ServiceTester = require('../service-tester') const { isMetric, @@ -12,17 +14,18 @@ const { isSemver, } = require('../test-validators') const { colorScheme: colorsB } = require('../test-helpers') -const { licenseToColor } = require('../../lib/licenses') -const { makeColor } = require('../../lib/badge-data') const { invalidJSON } = require('../response-fixtures') -const t = new ServiceTester({ id: 'github', title: 'Github' }) -module.exports = t const publicDomainLicenseColor = makeColor(licenseToColor('CC0-1.0')) const permissiveLicenseColor = colorsB[licenseToColor('MIT')] const copyleftLicenseColor = colorsB[licenseToColor('GPL-3.0')] const unknownLicenseColor = colorsB[licenseToColor()] +const t = (module.exports = new ServiceTester({ + id: 'github', + title: 'Github', +})) + t.create('Public domain license') .get('/license/github/gitignore.json?style=_shields_test') .expectJSON({ diff --git a/services/gitlab/gitlab-pipeline-status.tester.js b/services/gitlab/gitlab-pipeline-status.tester.js index e23ddded4f835..01e2a1a97e7fc 100644 --- a/services/gitlab/gitlab-pipeline-status.tester.js +++ b/services/gitlab/gitlab-pipeline-status.tester.js @@ -3,8 +3,7 @@ const Joi = require('joi') const { isPipelineStatus } = require('./gitlab-helpers') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Pipeline status') .get('/gitlab-org/gitlab-ce.json') diff --git a/services/gitter/gitter.tester.js b/services/gitter/gitter.tester.js index 93d45ce05f104..07e6c5fa579e9 100644 --- a/services/gitter/gitter.tester.js +++ b/services/gitter/gitter.tester.js @@ -1,9 +1,6 @@ 'use strict' -const createServiceTester = require('../create-service-tester') -const t = createServiceTester() - -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('on gitter') .get('/nwjs/nw.js.json') diff --git a/services/gratipay/gratipay.tester.js b/services/gratipay/gratipay.tester.js index feb28c7d76148..f88d590f9478e 100644 --- a/services/gratipay/gratipay.tester.js +++ b/services/gratipay/gratipay.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'gratipay', title: 'Gratipay' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'gratipay', + title: 'Gratipay', +})) t.create('Receiving') .get('/Gratipay.json') diff --git a/services/hackage/hackage.tester.js b/services/hackage/hackage.tester.js index 9f18b2d17354b..78de207168b4c 100644 --- a/services/hackage/hackage.tester.js +++ b/services/hackage/hackage.tester.js @@ -2,11 +2,12 @@ const Joi = require('joi') const ServiceTester = require('../service-tester') - const { isVPlusDottedVersionAtLeastOne } = require('../test-validators') -const t = new ServiceTester({ id: 'hackage', title: 'Hackage' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'hackage', + title: 'Hackage', +})) t.create('hackage version (valid)') .get('/v/lens.json') diff --git a/services/hexpm/hexpm.tester.js b/services/hexpm/hexpm.tester.js index 96de017a2300b..b4634feee2aa4 100644 --- a/services/hexpm/hexpm.tester.js +++ b/services/hexpm/hexpm.tester.js @@ -7,8 +7,7 @@ const { colorScheme } = require('../test-helpers') const isHexpmVersion = Joi.string().regex(/^v\d+.\d+.?\d?$/) -const t = new ServiceTester({ id: 'hexpm', title: 'Hex.pm' }) -module.exports = t +const t = (module.exports = new ServiceTester({ id: 'hexpm', title: 'Hex.pm' })) t.create('downloads per week') .get('/dw/cowboy.json') diff --git a/services/homebrew/homebrew.tester.js b/services/homebrew/homebrew.tester.js index fb3c3ab084445..1df0e2e1df483 100644 --- a/services/homebrew/homebrew.tester.js +++ b/services/homebrew/homebrew.tester.js @@ -5,8 +5,10 @@ const ServiceTester = require('../service-tester') const { isVPlusTripleDottedVersion } = require('../test-validators') const { invalidJSON } = require('../response-fixtures') -const t = new ServiceTester({ id: 'homebrew', title: 'homebrew' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'homebrew', + title: 'homebrew', +})) t.create('homebrew (valid)') .get('/v/cake.json') diff --git a/services/imagelayers/imagelayers.tester.js b/services/imagelayers/imagelayers.tester.js index f3833be13d240..b30fd487dfdee 100644 --- a/services/imagelayers/imagelayers.tester.js +++ b/services/imagelayers/imagelayers.tester.js @@ -2,8 +2,10 @@ const ServiceTester = require('../service-tester') -const t = new ServiceTester({ id: 'imagelayers', title: 'ImageLayers' }) -module.exports = t +const t = (module.exports = new ServiceTester({ + id: 'imagelayers', + title: 'ImageLayers', +})) t.create('no longer available (previously image size)') .get('/image-size/_/ubuntu/latest.json') diff --git a/services/jenkins/jenkins-plugin-installs.tester.js b/services/jenkins/jenkins-plugin-installs.tester.js index 34706f4d0573b..d0f7a45ee1ee9 100644 --- a/services/jenkins/jenkins-plugin-installs.tester.js +++ b/services/jenkins/jenkins-plugin-installs.tester.js @@ -3,8 +3,7 @@ const Joi = require('joi') const { isMetric } = require('../test-validators') -const createServiceTester = require('../create-service-tester') -const t = createServiceTester() +const t = (module.exports = require('../create-service-tester')()) // total installs diff --git a/services/leanpub/leanpub-book-summary.tester.js b/services/leanpub/leanpub-book-summary.tester.js index b41f492d9b6a8..797edc468cc4a 100644 --- a/services/leanpub/leanpub-book-summary.tester.js +++ b/services/leanpub/leanpub-book-summary.tester.js @@ -1,11 +1,11 @@ 'use strict' const Joi = require('joi') -const t = require('../create-service-tester')() -module.exports = t const knownValidBook = 'juice-shop' +const t = (module.exports = require('../create-service-tester')()) + t.create('known book pages') .get(`/pages/${knownValidBook}.json`) .expectJSONTypes( diff --git a/services/librariesio/librariesio-dependent-repos.tester.js b/services/librariesio/librariesio-dependent-repos.tester.js index e0c281837e57d..00418f175e64f 100644 --- a/services/librariesio/librariesio-dependent-repos.tester.js +++ b/services/librariesio/librariesio-dependent-repos.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isMetric } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('dependent repo count') .get('/npm/got.json') diff --git a/services/librariesio/librariesio-dependents.tester.js b/services/librariesio/librariesio-dependents.tester.js index 1da3504f7953b..87c16aa028ae5 100644 --- a/services/librariesio/librariesio-dependents.tester.js +++ b/services/librariesio/librariesio-dependents.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isMetric } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('dependent count') .get('/npm/got.json') diff --git a/services/librariesio/librariesio-sourcerank.tester.js b/services/librariesio/librariesio-sourcerank.tester.js index 7fa05d264eec2..822636db4b592 100644 --- a/services/librariesio/librariesio-sourcerank.tester.js +++ b/services/librariesio/librariesio-sourcerank.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { anyInteger } = require('../validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('sourcerank') .get('/npm/got.json') diff --git a/services/nexus/nexus.tester.js b/services/nexus/nexus.tester.js index 9120bf7901d18..7988e2f47e16f 100644 --- a/services/nexus/nexus.tester.js +++ b/services/nexus/nexus.tester.js @@ -3,8 +3,7 @@ const Joi = require('joi') const { invalidJSON } = require('../response-fixtures') -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('search release version') .get('/r/https/repository.jboss.org/nexus/jboss/jboss-client.json') diff --git a/services/node/node.tester.js b/services/node/node.tester.js index dbcce855fec67..78c3a4ece3f16 100644 --- a/services/node/node.tester.js +++ b/services/node/node.tester.js @@ -2,11 +2,9 @@ const { expect } = require('chai') const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { Range } = require('semver') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) function expectSemverRange(value) { expect(() => new Range(value)).not.to.throw() diff --git a/services/npm/npm-license.tester.js b/services/npm/npm-license.tester.js index a221803517501..9c4bf525898f6 100644 --- a/services/npm/npm-license.tester.js +++ b/services/npm/npm-license.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { colorScheme: colorsB } = require('../test-helpers') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('gets the license of express') .get('/express.json') diff --git a/services/npm/npm-type-definitions.tester.js b/services/npm/npm-type-definitions.tester.js index afb3fee0429ae..5a3350944ef4a 100644 --- a/services/npm/npm-type-definitions.tester.js +++ b/services/npm/npm-type-definitions.tester.js @@ -1,15 +1,13 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') - -const t = createServiceTester() -module.exports = t const isTypeDefinition = Joi.string().regex( /^((Flow|TypeScript)|(Flow \| TypeScript))$/ ) +const t = (module.exports = require('../create-service-tester')()) + t.create('types (from dev dependencies + files)') .get('/chalk.json') .expectJSONTypes( diff --git a/services/npm/npm-version.tester.js b/services/npm/npm-version.tester.js index d2679339d354a..87e97cb438a60 100644 --- a/services/npm/npm-version.tester.js +++ b/services/npm/npm-version.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isSemver } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('gets the package version of left-pad') .get('/left-pad.json') diff --git a/services/readthedocs/readthedocs.tester.js b/services/readthedocs/readthedocs.tester.js index e81c7ec0cde1a..c4fb754de6e76 100644 --- a/services/readthedocs/readthedocs.tester.js +++ b/services/readthedocs/readthedocs.tester.js @@ -1,11 +1,9 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isBuildStatus } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('build status') .get('/pip.json') diff --git a/services/requires/requires.tester.js b/services/requires/requires.tester.js index ff18b85372a96..7493d1fec081c 100644 --- a/services/requires/requires.tester.js +++ b/services/requires/requires.tester.js @@ -1,14 +1,12 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const isRequireStatus = Joi.string().regex( /^(up to date|outdated|insecure|unknown)$/ ) -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('requirements (valid, without branch)') .get('/github/celery/celery.json') diff --git a/services/shippable/shippable.tester.js b/services/shippable/shippable.tester.js index 61d605001a7b3..b41462ab32117 100644 --- a/services/shippable/shippable.tester.js +++ b/services/shippable/shippable.tester.js @@ -1,12 +1,10 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { invalidJSON } = require('../response-fixtures') const { isBuildStatus } = require('../test-validators') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('build status (valid, without branch)') .get('/5444c5ecb904a4b21567b0ff.json') diff --git a/services/stackexchange/stackexchange-monthlyquestions.tester.js b/services/stackexchange/stackexchange-monthlyquestions.tester.js index aa6a4e280f7f0..ce201cbd505ab 100644 --- a/services/stackexchange/stackexchange-monthlyquestions.tester.js +++ b/services/stackexchange/stackexchange-monthlyquestions.tester.js @@ -2,8 +2,8 @@ const Joi = require('joi') const { isMetricOverTimePeriod } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t + +const t = (module.exports = require('../create-service-tester')()) t.create('Monthly Questions for StackOverflow Momentjs') .get('/stackoverflow/qm/momentjs.json') diff --git a/services/stackexchange/stackexchange-reputation.tester.js b/services/stackexchange/stackexchange-reputation.tester.js index e5920123d6d84..2983c8510a77b 100644 --- a/services/stackexchange/stackexchange-reputation.tester.js +++ b/services/stackexchange/stackexchange-reputation.tester.js @@ -2,8 +2,8 @@ const Joi = require('joi') const { isMetric } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t + +const t = (module.exports = require('../create-service-tester')()) t.create('Invalid parameters') .get('/stackoverflow/r/invalidimage.json') diff --git a/services/stackexchange/stackexchange-taginfo.tester.js b/services/stackexchange/stackexchange-taginfo.tester.js index 018551c73b536..def7bc6127e33 100644 --- a/services/stackexchange/stackexchange-taginfo.tester.js +++ b/services/stackexchange/stackexchange-taginfo.tester.js @@ -2,8 +2,8 @@ const Joi = require('joi') const { isMetric } = require('../test-validators') -const t = require('../create-service-tester')() -module.exports = t + +const t = (module.exports = require('../create-service-tester')()) t.create('JavaScript Questions') .get('/stackoverflow/t/javascript.json') diff --git a/services/static-badge/static-badge.tester.js b/services/static-badge/static-badge.tester.js index 00503a8eb3a97..fc2c2ac506544 100644 --- a/services/static-badge/static-badge.tester.js +++ b/services/static-badge/static-badge.tester.js @@ -1,7 +1,6 @@ 'use strict' -const t = require('../create-service-tester')() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Shields colorscheme color') .get('/badge/label-message-blue.json?style=_shields_test') diff --git a/services/swagger/swagger.tester.js b/services/swagger/swagger.tester.js index f11ffda16d4fb..6355217985f1b 100644 --- a/services/swagger/swagger.tester.js +++ b/services/swagger/swagger.tester.js @@ -1,14 +1,14 @@ 'use strict' -const createServiceTester = require('../create-service-tester') const { colorScheme } = require('../test-helpers') -const t = createServiceTester() const getURL = '/https/example.com/example.json.json?style=_shields_test' const apiURL = 'http://online.swagger.io' const apiGetURL = '/validator/debug' const apiGetQueryParams = { url: 'https://example.com/example.json' } +const t = (module.exports = require('../create-service-tester')()) + t.create('Valid (mocked)') .get(getURL) .intercept(nock => diff --git a/services/uptimerobot/uptimerobot-ratio.tester.js b/services/uptimerobot/uptimerobot-ratio.tester.js index b23858a5e3d5f..0c2e68d7397e5 100644 --- a/services/uptimerobot/uptimerobot-ratio.tester.js +++ b/services/uptimerobot/uptimerobot-ratio.tester.js @@ -1,13 +1,10 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') - const { isPercentage } = require('../test-validators') const { invalidJSON } = require('../response-fixtures') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Uptime Robot: Percentage (valid)') .get('/m778918918-3e92c097147760ee39d02d36.json') diff --git a/services/uptimerobot/uptimerobot-status.tester.js b/services/uptimerobot/uptimerobot-status.tester.js index f65205fb9b559..8b39c755e6257 100644 --- a/services/uptimerobot/uptimerobot-status.tester.js +++ b/services/uptimerobot/uptimerobot-status.tester.js @@ -1,7 +1,7 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') +const { invalidJSON } = require('../response-fixtures') const isUptimeStatus = Joi.string().valid( 'paused', @@ -10,10 +10,8 @@ const isUptimeStatus = Joi.string().valid( 'seems down', 'down' ) -const { invalidJSON } = require('../response-fixtures') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Uptime Robot: Status (valid)') .get('/m778918918-3e92c097147760ee39d02d36.json') diff --git a/services/wercker/wercker.tester.js b/services/wercker/wercker.tester.js index 2470389fa96b9..1f9bbb74208c1 100644 --- a/services/wercker/wercker.tester.js +++ b/services/wercker/wercker.tester.js @@ -1,12 +1,10 @@ 'use strict' const Joi = require('joi') -const createServiceTester = require('../create-service-tester') const { isBuildStatus } = require('../test-validators') const { colorScheme } = require('../test-helpers') -const t = createServiceTester() -module.exports = t +const t = (module.exports = require('../create-service-tester')()) t.create('Build status') .get('/build/wercker/go-wercker-api.json')