Repository: codecov/uploader
Pull request #274 (2021-08-04 16:04:24)

fix: always pass pr to server as a number
Server validation requires that the `pr` value be a valid number.
This change requires the value of `pr` to be either a number or empty prior to uploading.

Discovered by @dbhobbs



Patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 68194a9..b5e9d73 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -159,20 +159,13 @@ jobs:
       - attach_workspace:
           # Must be absolute path or relative path from working_directory
           at: .
-      # https://superuser.com/a/1620000/54442
-      - run:
-          name: Install and set Node 16.x
-          command: |
-            $ErrorActionPreference="Stop"
-            nvm arch
-            nvm install 16 all
-            nvm use 16
       - run:
           name: Build Windows Binary
           command: |
-            $ErrorActionPreference="Stop"
-            node --version
-            npm ci; npm test; npm run build; npm run build-windows
+            npm ci
+            npm test
+            npm run build
+            npm run build-windows
 
       - persist_to_workspace:
           root: .
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index b2a1795..d6f0b7c 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -25,7 +25,6 @@
         "@types/glob": "7.1.4",
         "@types/jest": "26.0.24",
         "@types/js-yaml": "4.0.2",
-        "@types/mock-fs": "4.13.1",
         "@types/node": "16.3.3",
         "@types/superagent": "4.1.12",
         "@types/validator": "13.6.3",
@@ -37,7 +36,6 @@
         "jest": "27.0.6",
         "jest-spec-reporter": "1.0.17",
         "lint-staged": "11.1.1",
-        "mock-fs": "5.0.0",
         "nock": "13.1.1",
         "pkg": "5.1.0",
         "prettier": "2.3.2",
@@ -1227,15 +1225,6 @@
       "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
       "dev": true
     },
-    "node_modules/@types/mock-fs": {
-      "version": "4.13.1",
-      "resolved": "https://registry.npmjs.org/@types/mock-fs/-/mock-fs-4.13.1.tgz",
-      "integrity": "sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==",
-      "dev": true,
-      "dependencies": {
-        "@types/node": "*"
-      }
-    },
     "node_modules/@types/node": {
       "version": "16.3.3",
       "resolved": "https://registry.npmjs.org/@types/node/-/node-16.3.3.tgz",
@@ -5157,12 +5146,6 @@
       "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
       "dev": true
     },
-    "node_modules/mock-fs": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.0.0.tgz",
-      "integrity": "sha512-A5mm/SpSDwwc/klSaEvvKMGQQtiGiQy8UcDAd/vpVO1fV+4zaHjt39yKgCSErFzv2zYxZIUx9Ud/7ybeHBf8Fg==",
-      "dev": true
-    },
     "node_modules/moment": {
       "version": "2.29.1",
       "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
@@ -8078,15 +8061,6 @@
       "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
       "dev": true
     },
-    "@types/mock-fs": {
-      "version": "4.13.1",
-      "resolved": "https://registry.npmjs.org/@types/mock-fs/-/mock-fs-4.13.1.tgz",
-      "integrity": "sha512-m6nFAJ3lBSnqbvDZioawRvpLXSaPyn52Srf7OfzjubYbYX8MTUdIgDxQl0wEapm4m/pNYSd9TXocpQ0TvZFlYA==",
-      "dev": true,
-      "requires": {
-        "@types/node": "*"
-      }
-    },
     "@types/node": {
       "version": "16.3.3",
       "resolved": "https://registry.npmjs.org/@types/node/-/node-16.3.3.tgz",
@@ -11023,12 +10997,6 @@
       "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
       "dev": true
     },
-    "mock-fs": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.0.0.tgz",
-      "integrity": "sha512-A5mm/SpSDwwc/klSaEvvKMGQQtiGiQy8UcDAd/vpVO1fV+4zaHjt39yKgCSErFzv2zYxZIUx9Ud/7ybeHBf8Fg==",
-      "dev": true
-    },
     "moment": {
       "version": "2.29.1",
       "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
diff --git a/package.json b/package.json
index 79ea94b..2d7472b 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,6 @@
     "@types/glob": "7.1.4",
     "@types/jest": "26.0.24",
     "@types/js-yaml": "4.0.2",
-    "@types/mock-fs": "4.13.1",
     "@types/node": "16.3.3",
     "@types/superagent": "4.1.12",
     "@types/validator": "13.6.3",
@@ -54,7 +53,6 @@
     "jest": "27.0.6",
     "jest-spec-reporter": "1.0.17",
     "lint-staged": "11.1.1",
-    "mock-fs": "5.0.0",
     "nock": "13.1.1",
     "pkg": "5.1.0",
     "prettier": "2.3.2",
diff --git a/src/ci_providers/provider_appveyorci.ts b/src/ci_providers/provider_appveyorci.ts
index ef30639..26eb857 100644
--- a/src/ci_providers/provider_appveyorci.ts
+++ b/src/ci_providers/provider_appveyorci.ts
@@ -43,9 +43,9 @@ function _getJob(envs: UploaderEnvs) {
   return ''
 }
 
-function _getPR(inputs: UploaderInputs) {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.APPVEYOR_PULL_REQUEST_NUMBER || ''
+  return Number(args.pr || envs.APPVEYOR_PULL_REQUEST_NUMBER || '')
 }
 
 function _getService() {
diff --git a/src/ci_providers/provider_azurepipelines.ts b/src/ci_providers/provider_azurepipelines.ts
index 6c8dcea..1c0a033 100644
--- a/src/ci_providers/provider_azurepipelines.ts
+++ b/src/ci_providers/provider_azurepipelines.ts
@@ -34,13 +34,13 @@ function _getJob(envs: UploaderEnvs): string {
   return envs.BUILD_BUILDID || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
   return (
-    args.pr ||
+    Number(args.pr ||
     envs.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER ||
     envs.SYSTEM_PULLREQUEST_PULLREQUESTID ||
-    ''
+    '')
   )
 }
 
diff --git a/src/ci_providers/provider_bitbucket.ts b/src/ci_providers/provider_bitbucket.ts
index e4e8923..0734b95 100644
--- a/src/ci_providers/provider_bitbucket.ts
+++ b/src/ci_providers/provider_bitbucket.ts
@@ -26,9 +26,9 @@ function _getJob(envs: UploaderEnvs): string {
   return envs.BITBUCKET_BUILD_NUMBER || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.BITBUCKET_PR_ID || ''
+  return Number(args.pr || envs.BITBUCKET_PR_ID || '')
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_buildkite.ts b/src/ci_providers/provider_buildkite.ts
index 5400b7f..565fdef 100644
--- a/src/ci_providers/provider_buildkite.ts
+++ b/src/ci_providers/provider_buildkite.ts
@@ -60,9 +60,9 @@ function _getJob(envs: UploaderEnvs): string {
  * @param {args: {}, envs: {}} inputs an object of arguments and enviromental variable key/value pairs
  * @returns {string}
  */
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args } = inputs
-  return args.pr || ''
+  return Number(args.pr || '')
 }
 
 /**
diff --git a/src/ci_providers/provider_circleci.ts b/src/ci_providers/provider_circleci.ts
index ef269d4..e262b9b 100644
--- a/src/ci_providers/provider_circleci.ts
+++ b/src/ci_providers/provider_circleci.ts
@@ -55,9 +55,9 @@ function _getBuild(inputs: UploaderInputs): string {
   return args.build || envs.CIRCLE_BUILD_NUM || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.CIRCLE_PR_NUMBER || ''
+  return Number(args.pr || envs.CIRCLE_PR_NUMBER || '')
 }
 
 function _getJob(envs: UploaderEnvs): string {
diff --git a/src/ci_providers/provider_cirrus.ts b/src/ci_providers/provider_cirrus.ts
index e78c513..d24409b 100644
--- a/src/ci_providers/provider_cirrus.ts
+++ b/src/ci_providers/provider_cirrus.ts
@@ -23,9 +23,9 @@ function _getJob(envs: UploaderEnvs): string {
   return envs.CIRRUS_TASK_ID || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.CIRRUS_PR || ''
+  return Number(args.pr || envs.CIRRUS_PR || '')
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_codebuild.ts b/src/ci_providers/provider_codebuild.ts
index 7945119..44dba83 100644
--- a/src/ci_providers/provider_codebuild.ts
+++ b/src/ci_providers/provider_codebuild.ts
@@ -28,15 +28,15 @@ function _getJob(envs: UploaderEnvs): string {
   return envs.CODEBUILD_BUILD_ID || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
   return (
-    args.pr ||
+    Number(args.pr ||
     (envs.CODEBUILD_SOURCE_VERSION &&
     envs.CODEBUILD_SOURCE_VERSION.startsWith('pr/')
       ? envs.CODEBUILD_SOURCE_VERSION.replace(/^pr\//, '')
       : '')
-  )
+  ))
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_drone.ts b/src/ci_providers/provider_drone.ts
index 5590144..335fc0b 100644
--- a/src/ci_providers/provider_drone.ts
+++ b/src/ci_providers/provider_drone.ts
@@ -24,9 +24,9 @@ function _getJob(envs: UploaderEnvs): string {
   return ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.DRONE_PULL_REQUEST || ''
+  return Number(args.pr || envs.DRONE_PULL_REQUEST || '')
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_githubactions.ts b/src/ci_providers/provider_githubactions.ts
index 868820c..d895ce2 100644
--- a/src/ci_providers/provider_githubactions.ts
+++ b/src/ci_providers/provider_githubactions.ts
@@ -40,7 +40,7 @@ function _getJob(envs: UploaderEnvs): string {
   return encodeURIComponent(envs.GITHUB_WORKFLOW || '')
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
   let match
   if (envs.GITHUB_HEAD_REF && envs.GITHUB_HEAD_REF !== '') {
@@ -50,7 +50,7 @@ function _getPR(inputs: UploaderInputs): string {
       match = matches[1]
     }
   }
-  return args.pr || match || ''
+  return Number(args.pr || match || '')
 }
 
 function _getService(): string {
@@ -66,7 +66,7 @@ function _getSHA(inputs: UploaderInputs): string {
   const pr = _getPR(inputs)
 
   let commit = envs.GITHUB_SHA
-  if (pr && pr.toLowerCase() !== 'false' && !args.sha) {
+  if (pr && pr !== 0 && !args.sha) {
     const mergeCommitRegex = /^[a-z0-9]{40} [a-z0-9]{40}$/
     const mergeCommitMessage = childProcess
       .spawnSync('git', ['show', '--no-patch', '--format="%P"'])
diff --git a/src/ci_providers/provider_gitlabci.ts b/src/ci_providers/provider_gitlabci.ts
index 3141521..8c54223 100644
--- a/src/ci_providers/provider_gitlabci.ts
+++ b/src/ci_providers/provider_gitlabci.ts
@@ -26,9 +26,9 @@ function _getJob(envs: UploaderEnvs): string {
   return ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args } = inputs
-  return args.pr || ''
+  return Number(args.pr || '')
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_jenkinsci.ts b/src/ci_providers/provider_jenkinsci.ts
index 363e389..e34e185 100644
--- a/src/ci_providers/provider_jenkinsci.ts
+++ b/src/ci_providers/provider_jenkinsci.ts
@@ -31,9 +31,9 @@ function _getJob(envs: UploaderEnvs) {
   return ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.ghprbPullId || envs.CHANGE_ID || ''
+  return Number(args.pr || envs.ghprbPullId || envs.CHANGE_ID || '')
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_local.ts b/src/ci_providers/provider_local.ts
index 5786966..e911570 100644
--- a/src/ci_providers/provider_local.ts
+++ b/src/ci_providers/provider_local.ts
@@ -40,9 +40,9 @@ function _getJob(env: UploaderEnvs): string {
 }
 
 // eslint-disable-next-line no-unused-vars
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args } = inputs
-  return args.pr || ''
+  return Number(args.pr || '')
 }
 
 // This is the value that gets passed to the Codecov uploader
diff --git a/src/ci_providers/provider_teamcity.ts b/src/ci_providers/provider_teamcity.ts
index 2df5b9b..b137314 100644
--- a/src/ci_providers/provider_teamcity.ts
+++ b/src/ci_providers/provider_teamcity.ts
@@ -40,9 +40,9 @@ function _getBuild(inputs: UploaderInputs): string {
   return args.build || envs.BUILD_NUMBER || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args } = inputs
-  return args.pr || ''
+  return Number(args.pr || '')
 }
 
 // eslint-disable-next-line no-unused-vars
diff --git a/src/ci_providers/provider_travisci.ts b/src/ci_providers/provider_travisci.ts
index 8f0d0db..b3dcd8d 100644
--- a/src/ci_providers/provider_travisci.ts
+++ b/src/ci_providers/provider_travisci.ts
@@ -28,9 +28,9 @@ function _getJob(envs: UploaderEnvs): string {
   return envs.TRAVIS_JOB_ID || ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args, envs } = inputs
-  return args.pr || envs.TRAVIS_PULL_REQUEST || ''
+  return Number(args.pr || envs.TRAVIS_PULL_REQUEST || '')
 }
 
 function _getService(): string {
diff --git a/src/ci_providers/provider_wercker.ts b/src/ci_providers/provider_wercker.ts
index 132b912..1a7bf5a 100644
--- a/src/ci_providers/provider_wercker.ts
+++ b/src/ci_providers/provider_wercker.ts
@@ -25,9 +25,9 @@ function _getJob(envs: UploaderEnvs): string {
   return ''
 }
 
-function _getPR(inputs: UploaderInputs): string {
+export function _getPR(inputs: UploaderInputs): number {
   const { args } = inputs
-  return args.pr || ''
+  return Number(args.pr || '')
 }
 
 function _getService(): string {
diff --git a/src/helpers/files.ts b/src/helpers/files.ts
index efea3ce..93e12ba 100644
--- a/src/helpers/files.ts
+++ b/src/helpers/files.ts
@@ -5,8 +5,7 @@ import fs from 'fs'
 import glob from 'fast-glob'
 import { posix as path } from 'path'
 import { logAndThrow } from './util'
-import { logError, verbose } from './logger'
-import { readFile } from 'fs/promises'
+import { info, logError, verbose } from './logger'
 
 export const MARKER_NETWORK_END = '<<<<<< network\n'
 export const MARKER_FILE_END = '<<<<<< EOF\n'
@@ -294,15 +293,18 @@ export function readAllLines(filePath: string): string[] {
  * @param {string} filePath
  * @returns {string}
  */
-export async function readCoverageFile(
+export function readCoverageFile(
   projectRoot: string,
   filePath: string,
-): Promise<string> {
-  return readFile(getFilePath(projectRoot, filePath), {
-    encoding: 'utf-8',
-  }).catch(err => {
-    logAndThrow(`There was an error reading the coverage file: ${err}`)
-  })
+): string {
+  try {
+    return fs.readFileSync(getFilePath(projectRoot, filePath), {
+      encoding: 'utf-8',
+    })
+  } catch (error) {
+    logAndThrow(`There was an error reading the coverage file: ${error}`)
+  }
+  return ''
 }
 
 /**
diff --git a/src/helpers/validate.ts b/src/helpers/validate.ts
index 5a84149..bdbb245 100644
--- a/src/helpers/validate.ts
+++ b/src/helpers/validate.ts
@@ -1,6 +1,7 @@
 import { UploaderArgs } from '../types'
 
 import validator from 'validator'
+import { logAndThrow } from './util'
 
 /**
  *
@@ -59,3 +60,10 @@ export function fetchToken(args: UploaderArgs): string {
   }
   return token
 }
+
+export function checkValueType(name: string, value: unknown, type: string): void {
+  if (typeof value !== type) {
+    return logAndThrow(`The value of ${name} is not of type ${type}, can not continue, please review: ${value}`)
+  }
+}
+
diff --git a/src/helpers/web.ts b/src/helpers/web.ts
index 62fc5b0..c21e2d6 100644
--- a/src/helpers/web.ts
+++ b/src/helpers/web.ts
@@ -5,6 +5,7 @@ import { version } from '../../package.json'
 import * as validateHelpers from './validate'
 import { info, logError } from './logger'
 import { logAndThrow } from './util'
+import { checkValueType } from './validate'
 
 /**
  *
@@ -132,7 +133,12 @@ function camelToSnake(str: string): string {
  * @returns {string}
  */
 export function generateQuery(queryParams: IServiceParams): string {
+  checkValueType('pr', queryParams.pr, 'number')
+  if (queryParams.pr === 0) {
+    queryParams.pr = ''
+  }
   return Object.entries(queryParams)
     .map(([key, value]) => `${camelToSnake(key)}=${value}`)
     .join('&')
 }
+
diff --git a/src/types.ts b/src/types.ts
index f323068..0a6da8a 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -42,7 +42,7 @@ export interface IServiceParams {
   buildURL: string
   commit: string
   job: string
-  pr: string
+  pr: number | ''
   service: string
   slug: string
   name?: string


Test patch:
diff --git a/test/helpers/files.test.ts b/test/helpers/files.test.ts
index c5737b6..e6e7289 100644
--- a/test/helpers/files.test.ts
+++ b/test/helpers/files.test.ts
@@ -2,12 +2,10 @@ import td from 'testdouble'
 import fs from 'fs'
 import childProcess from 'child_process'
 import * as fileHelpers from '../../src/helpers/files'
-import mock from 'mock-fs'
 
 describe('File Helpers', () => {
   afterEach(() => {
     td.reset()
-    mock.restore()
   })
 
   it('provides network end marker', () => {
@@ -74,30 +72,17 @@ describe('File Helpers', () => {
       )
     })
     it('can read a coverage report file', async () => {
-
-      mock({
-        'test-coverage-file.xml': 'I am test coverage data'
-      })
-
-      const reportContents = await fileHelpers.readCoverageFile(
+      const readFileSync = td.replace(fs, 'readFileSync')
+      td.when(
+        readFileSync('test-coverage-file.xml', { encoding: 'utf-8' }),
+      ).thenReturn('I am test coverage data')
+      const reportContents = fileHelpers.readCoverageFile(
         '.',
         'test-coverage-file.xml',
       )
       expect(reportContents).toBe('I am test coverage data')
     })
 
-    it('throws when unable to read a coverage file', async () => {
-
-      mock({
-        'test-coverage-file.xml': 'I am test coverage data'
-      })
-
-      await expect(fileHelpers.readCoverageFile(
-        '.',
-        'test-no-coverage-file.xml',
-      )).rejects.toThrowError(/no such file or directory/)
-    })
-
     it('can return a list of coverage files', async () => {
       const results = await fileHelpers.getCoverageFiles(
         '.',
diff --git a/test/helpers/validate.test.ts b/test/helpers/validate.test.ts
index 4587bf4..0d7c760 100644
--- a/test/helpers/validate.test.ts
+++ b/test/helpers/validate.test.ts
@@ -1,9 +1,16 @@
 import * as validate from '../../src/helpers/validate'
+import { checkValueType } from '../../src/helpers/validate'
 
 // Backup the env
 const realEnv = { ...process.env }
 
 describe('Input Validators', () => {
+  describe('checkValueType()', () => {
+it('throws an error when the value is not the correct type', () => {
+  expect(() => { checkValueType('testValue', {}, 'number')}).toThrowError(/The value of testValue is not of type number, can not continue, please review/)
+})
+  })
+
   describe('Tokens', () => {
     it('Returns true with a valid alphanumeric token', () => {
       expect(validate.validateToken('1bc123')).toBe(true)
diff --git a/test/helpers/web.test.ts b/test/helpers/web.test.ts
index 10b0b49..9df8c03 100644
--- a/test/helpers/web.test.ts
+++ b/test/helpers/web.test.ts
@@ -74,7 +74,7 @@ describe('Web Helpers', () => {
   })
 
   it('Can generate query URL', () => {
-    const queryParams = {
+    const queryParams: IServiceParams  = {
       branch: 'testBranch',
       commit: 'commitSHA',
       build: '4',
@@ -84,7 +84,7 @@ describe('Web Helpers', () => {
       slug: 'testOrg/testRepo',
       service: 'testingCI',
       flags: 'unit,uploader',
-      pr: '2',
+      pr: 2,
       job: '6',
     }
     expect(webHelper.generateQuery(queryParams)).toBe(
@@ -105,7 +105,7 @@ describe('Web Helpers', () => {
         job: '',
         service: 'Testing',
         slug: '',
-        pr: '',
+        pr: 0,
       },
     )
     expect(result.flags).toBe('testFlag')
@@ -124,7 +124,7 @@ describe('Web Helpers', () => {
         job: '',
         service: 'Testing',
         slug: '',
-        pr: '',
+        pr: 0,
       },
     )
     expect(result.flags).toBe('testFlag1,testFlag2')
diff --git a/test/providers/provider_appveyorci.test.ts b/test/providers/provider_appveyorci.test.ts
index ed015c6..af45bc6 100644
--- a/test/providers/provider_appveyorci.test.ts
+++ b/test/providers/provider_appveyorci.test.ts
@@ -1,7 +1,7 @@
 import td from 'testdouble'
 
 import * as providerAppveyorci from '../../src/ci_providers//provider_appveyorci'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('AppveyorCI Params', () => {
   afterEach(() => {
@@ -76,14 +76,14 @@ describe('AppveyorCI Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL:
         'https%3A%2F%2Fappveyor.com%2Fproject%2FtestOrg%2FtestRepo%2Fbuilds%2F2%2Fjob%2F1',
       commit: 'testingsha',
       job: 'testOrg%2FtestRepo%2F3',
-      pr: '4',
+      pr: 4,
       service: 'appveyor',
       slug: 'testOrg/testRepo',
     }
@@ -106,13 +106,13 @@ describe('AppveyorCI Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'appveyor',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_azurepipelines.test.ts b/test/providers/provider_azurepipelines.test.ts
index 3825320..0110ac8 100644
--- a/test/providers/provider_azurepipelines.test.ts
+++ b/test/providers/provider_azurepipelines.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerAzurepipelines from '../../src/ci_providers//provider_azurepipelines'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('Jenkins CI Params', () => {
   afterEach(() => {
@@ -60,14 +60,14 @@ describe('Jenkins CI Params', () => {
         SYSTEM_TEAMPROJECT: 'testOrg',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL:
         'https%3A%2F%2Fexample.azure.comtestOrg%2F_build%2Fresults%3FbuildId%3D2',
       commit: 'testingsha',
       job: '2',
-      pr: '3',
+      pr: 3,
       project: 'testOrg',
       server_uri: 'https://example.azure.com',
       service: 'azure_pipelines',
@@ -96,14 +96,14 @@ describe('Jenkins CI Params', () => {
         SYSTEM_TEAMPROJECT: 'testOrg',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL:
         'https%3A%2F%2Fexample.azure.comtestOrg%2F_build%2Fresults%3FbuildId%3D2',
       commit: 'testingsha',
       job: '2',
-      pr: '3',
+      pr: 3,
       project: 'testOrg',
       server_uri: 'https://example.azure.com',
       service: 'azure_pipelines',
@@ -132,14 +132,14 @@ describe('Jenkins CI Params', () => {
         SYSTEM_TEAMPROJECT: 'testOrg',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL:
         'https%3A%2F%2Fexample.azure.comtestOrg%2F_build%2Fresults%3FbuildId%3D2',
       commit: 'testingmergecommitsha2345678901234567890',
       job: '2',
-      pr: '3',
+      pr: 3,
       project: 'testOrg',
       server_uri: 'https://example.azure.com',
       service: 'azure_pipelines',
@@ -172,13 +172,13 @@ describe('Jenkins CI Params', () => {
         SYSTEM_TEAMFOUNDATIONSERVERURI: 'https://example.azure.com',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       project: '',
       server_uri: 'https://example.azure.com',
       service: 'azure_pipelines',
diff --git a/test/providers/provider_bitbucket.test.ts b/test/providers/provider_bitbucket.test.ts
index e925a72..d0cfe0b 100644
--- a/test/providers/provider_bitbucket.test.ts
+++ b/test/providers/provider_bitbucket.test.ts
@@ -1,7 +1,7 @@
 import childProcess from 'child_process'
 import td from 'testdouble'
 import * as providerBitbucket from '../../src/ci_providers//provider_bitbucket'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('Bitbucket Params', () => {
   afterEach(() => {
@@ -53,13 +53,13 @@ describe('Bitbucket Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '1',
       buildURL: '',
       commit: '',
       job: '1',
-      pr: '',
+      pr: 0,
       service: 'bitbucket',
       slug: '',
     }
@@ -85,13 +85,13 @@ describe('Bitbucket Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: '',
       commit: 'testingsha',
       job: '1',
-      pr: '2',
+      pr: 2,
       service: 'bitbucket',
       slug: 'testOwner/testSlug',
     }
@@ -116,13 +116,13 @@ describe('Bitbucket Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: '',
       commit: 'testingsha',
       job: '1',
-      pr: '',
+      pr: 0,
       service: 'bitbucket',
       slug: 'testOwner/testSlug',
     }
@@ -147,13 +147,13 @@ describe('Bitbucket Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: '',
       commit: 'newtestsha',
       job: '1',
-      pr: '',
+      pr: 0,
       service: 'bitbucket',
       slug: 'testOwner/testSlug',
     }
@@ -189,13 +189,13 @@ describe('Bitbucket Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'feature',
       build: '3',
       buildURL: '',
       commit: 'overwriteSha',
       job: '1',
-      pr: '4',
+      pr: 4,
       service: 'bitbucket',
       slug: 'overwriteOwner/overwriteRepo',
     }
diff --git a/test/providers/provider_buildkite.test.ts b/test/providers/provider_buildkite.test.ts
index 113803c..cdf8941 100644
--- a/test/providers/provider_buildkite.test.ts
+++ b/test/providers/provider_buildkite.test.ts
@@ -1,6 +1,6 @@
 import td from 'testdouble'
 import * as providerBuildkite from '../../src/ci_providers/provider_buildkite'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('Buildkite Params', () => {
   afterEach(() => {
@@ -48,13 +48,13 @@ describe('Buildkite Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: 'https://buildkite.com/testOrg/testRepo',
       commit: 'testingsha',
       job: '3',
-      pr: '',
+      pr: 0,
       service: 'buildkite',
       slug: 'testRepo',
     }
@@ -80,13 +80,13 @@ describe('Buildkite Params', () => {
         CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'buildkite',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_circleci.test.ts b/test/providers/provider_circleci.test.ts
index 1927314..9f945fa 100644
--- a/test/providers/provider_circleci.test.ts
+++ b/test/providers/provider_circleci.test.ts
@@ -1,6 +1,7 @@
 import td from 'testdouble'
 
 import * as providerCircleci from '../../src/ci_providers//provider_circleci'
+import { IServiceParams } from '../../src/types'
 
 describe('CircleCI Params', () => {
   afterEach(() => {
@@ -48,13 +49,13 @@ describe('CircleCI Params', () => {
         CIRCLE_NODE_INDEX: '3',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'master',
       build: '2',
       buildURL: '',
       commit: 'testingsha',
       job: '3',
-      pr: '1',
+      pr: 1,
       service: 'circleci',
       slug: 'testOrg/testRepo',
     }
@@ -79,13 +80,13 @@ describe('CircleCI Params', () => {
         CIRCLE_NODE_INDEX: '3',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'master',
       build: '2',
       buildURL: '',
       commit: 'testingsha',
       job: '3',
-      pr: '1',
+      pr: 1,
       service: 'circleci',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_cirrus.test.ts b/test/providers/provider_cirrus.test.ts
index 237a480..f12c4fe 100644
--- a/test/providers/provider_cirrus.test.ts
+++ b/test/providers/provider_cirrus.test.ts
@@ -1,7 +1,7 @@
 import td from 'testdouble'
 
 import * as providerCirrus from '../../src/ci_providers/provider_cirrus'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('Cirrus Params', () => {
   afterEach(() => {
@@ -49,13 +49,13 @@ describe('Cirrus Params', () => {
         CIRRUS_REPO_FULL_NAME: 'https:/example.com/repo',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'master',
       build: '2',
       buildURL: '',
       commit: 'testingsha',
       job: '',
-      pr: '1',
+      pr: 1,
       service: 'cirrus-ci',
       slug: 'https:/example.com/repo',
     }
@@ -86,13 +86,13 @@ describe('Cirrus Params', () => {
         CIRRUS_REPO_FULL_NAME: 'https:/example.com/repo',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'cirrus-ci',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_codebuild.test.ts b/test/providers/provider_codebuild.test.ts
index f202ca1..6b9332c 100644
--- a/test/providers/provider_codebuild.test.ts
+++ b/test/providers/provider_codebuild.test.ts
@@ -1,7 +1,7 @@
 import td from 'testdouble'
 
 import * as providerCodeBuild from '../../src/ci_providers/provider_codebuild'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('CodeBuild Params', () => {
   afterEach(() => {
@@ -55,13 +55,13 @@ describe('CodeBuild Params', () => {
           CODEBUILD_SOURCE_REPO_URL: 'https://github.com/repo.git',
         },
       }
-      const expected = {
+      const expected: IServiceParams = {
         branch: 'master',
         build: '2',
         buildURL: '',
         commit: 'testingsha',
         job: '2',
-        pr: '1',
+        pr: 1,
         service: 'codebuild',
         slug: 'repo',
       }
@@ -92,13 +92,13 @@ describe('CodeBuild Params', () => {
           CODEBUILD_SOURCE_REPO_URL: 'https://github.com/repo.git',
         },
       }
-      const expected = {
+      const expected: IServiceParams = {
         branch: 'branch',
         build: '3',
         buildURL: '',
         commit: 'testsha',
         job: '2',
-        pr: '7',
+        pr: 7,
         service: 'codebuild',
         slug: 'testOrg/testRepo',
       }
diff --git a/test/providers/provider_drone.test.ts b/test/providers/provider_drone.test.ts
index 9b59bee..91e93c1 100644
--- a/test/providers/provider_drone.test.ts
+++ b/test/providers/provider_drone.test.ts
@@ -1,6 +1,7 @@
 import td from 'testdouble'
 
 import * as providerDrone from '../../src/ci_providers/provider_drone'
+import { IServiceParams } from '../../src/types'
 
 describe('Drone Params', () => {
   afterEach(() => {
@@ -49,13 +50,13 @@ describe('Drone Params', () => {
         DRONE_REPO_LINK: 'https:/example.com/repo',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'master',
       build: '2',
       buildURL: 'https://www.drone.io/',
       commit: 'testingsha',
       job: '',
-      pr: '1',
+      pr: 1,
       service: 'drone',
       slug: 'https:/example.com/repo',
     }
diff --git a/test/providers/provider_githubactions.test.ts b/test/providers/provider_githubactions.test.ts
index abb8e0a..c41fb1b 100644
--- a/test/providers/provider_githubactions.test.ts
+++ b/test/providers/provider_githubactions.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerGitHubactions from '../../src/ci_providers//provider_githubactions'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('GitHub Actions Params', () => {
   afterEach(() => {
@@ -57,14 +57,14 @@ describe('GitHub Actions Params', () => {
         GITHUB_WORKFLOW: 'testWorkflow',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'master',
       build: '2',
       buildURL:
         'https%3A%2F%2Fgithub.com%2FtestOrg%2FtestRepo%2Factions%2Fruns%2F2',
       commit: 'testingsha',
       job: 'testWorkflow',
-      pr: '',
+      pr: 0,
       service: 'github-actions',
       slug: 'testOrg/testRepo',
     }
@@ -91,14 +91,14 @@ describe('GitHub Actions Params', () => {
         GITHUB_WORKFLOW: 'testWorkflow',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '2',
       buildURL:
         'https%3A%2F%2Fgithub.com%2FtestOrg%2FtestRepo%2Factions%2Fruns%2F2',
       commit: 'testingsha',
       job: 'testWorkflow',
-      pr: '1',
+      pr: 1,
       service: 'github-actions',
       slug: 'testOrg/testRepo',
     }
@@ -132,14 +132,14 @@ describe('GitHub Actions Params', () => {
         GITHUB_WORKFLOW: 'testWorkflow',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '2',
       buildURL:
         'https%3A%2F%2Fgithub.com%2FtestOrg%2FtestRepo%2Factions%2Fruns%2F2',
       commit: 'testingmergecommitsha2345678901234567890',
       job: 'testWorkflow',
-      pr: '1',
+      pr: 1,
       service: 'github-actions',
       slug: 'testOrg/testRepo',
     }
@@ -173,14 +173,14 @@ describe('GitHub Actions Params', () => {
         GITHUB_SERVER_URL: 'https://github.com',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL:
         'https%3A%2F%2Fgithub.com%2FtestOrg%2FtestRepo%2Factions%2Fruns%2F3',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'github-actions',
       slug: 'testOrg/testRepo',
     }
@@ -212,14 +212,14 @@ describe('GitHub Actions Params', () => {
         GITHUB_WORKFLOW: 'testWorkflow',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '2',
       buildURL:
         'https%3A%2F%2Fgithub.com%2FtestOrg%2FtestRepo%2Factions%2Fruns%2F2',
       commit: 'testingsha',
       job: 'testWorkflow',
-      pr: '1',
+      pr: 1,
       service: 'github-actions',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_gitlabci.test.ts b/test/providers/provider_gitlabci.test.ts
index 27a38a0..3a81e67 100644
--- a/test/providers/provider_gitlabci.test.ts
+++ b/test/providers/provider_gitlabci.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerGitLabci from '../../src/ci_providers//provider_gitlabci'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('GitLabCI Params', () => {
   afterEach(() => {
@@ -45,13 +45,13 @@ describe('GitLabCI Params', () => {
         GITLAB_CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '',
       buildURL: '',
       commit: '',
       job: '',
-      pr: '',
+      pr: 0,
       service: 'gitlab',
       slug: '',
     }
@@ -82,13 +82,13 @@ describe('GitLabCI Params', () => {
         GITLAB_CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: '',
       commit: 'testingsha',
       job: '',
-      pr: '',
+      pr: 0,
       service: 'gitlab',
       slug: 'testOrg/testRepo',
     }
@@ -112,13 +112,13 @@ describe('GitLabCI Params', () => {
         GITLAB_CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'master',
       build: '2',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '',
+      pr: 0,
       service: 'gitlab',
       slug: 'testOrg/testRepo',
     }
@@ -202,13 +202,13 @@ describe('GitLabCI Params', () => {
         GITLAB_CI: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'gitlab',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_jenkinsci.test.ts b/test/providers/provider_jenkinsci.test.ts
index 7cb46bb..7760aa7 100644
--- a/test/providers/provider_jenkinsci.test.ts
+++ b/test/providers/provider_jenkinsci.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerJenkinsci from '../../src/ci_providers//provider_jenkinsci'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('Jenkins CI Params', () => {
   afterEach(() => {
@@ -57,13 +57,13 @@ describe('Jenkins CI Params', () => {
         JENKINS_URL: 'https://example.com',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: 'https%3A%2F%2Fexample.jenkins.com',
       commit: 'testingsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'jenkins',
       slug: '',
     }
@@ -118,13 +118,13 @@ describe('Jenkins CI Params', () => {
         JENKINS_URL: 'https://example.com',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'jenkins',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_local.test.ts b/test/providers/provider_local.test.ts
index 9121511..d3ae1c5 100644
--- a/test/providers/provider_local.test.ts
+++ b/test/providers/provider_local.test.ts
@@ -2,7 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerLocal from '../../src/ci_providers//provider_local'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('Local Params', () => {
   afterEach(() => {
@@ -55,13 +55,13 @@ describe('Local Params', () => {
       },
       envs: {},
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '',
       buildURL: '',
       commit: 'testingsha',
       job: '',
-      pr: '1',
+      pr: 1,
       service: '',
       slug: 'owner/repo',
     }
diff --git a/test/providers/provider_teamcity.test.ts b/test/providers/provider_teamcity.test.ts
index 9a69835..a66d0d4 100644
--- a/test/providers/provider_teamcity.test.ts
+++ b/test/providers/provider_teamcity.test.ts
@@ -2,6 +2,7 @@ import td from 'testdouble'
 import childProcess from 'child_process'
 
 import * as providerTeamCity from '../../src/ci_providers/provider_teamcity'
+import { IServiceParams } from '../../src/types'
 
 describe('TeamCity Params', () => {
   afterEach(() => {
@@ -51,13 +52,13 @@ describe('TeamCity Params', () => {
         BUILD_NUMBER: '1',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: '',
       commit: 'testingsha',
       job: '',
-      pr: '',
+      pr: 0,
       service: 'teamcity',
       slug: '',
     }
@@ -85,13 +86,13 @@ describe('TeamCity Params', () => {
         BUILD_NUMBER: '1',
       },
     }
-    const expected = {
+    const expected : IServiceParams= {
       branch: 'main',
       build: '1',
       buildURL: '',
       commit: 'testingsha',
       job: '',
-      pr: '',
+      pr: 0,
       service: 'teamcity',
       slug: 'testOrg/testRepo',
     }
@@ -128,13 +129,13 @@ describe('TeamCity Params', () => {
     td.when(
       spawnSync('git', ['config', '--get', 'remote.origin.url']),
     ).thenReturn({ stdout: '' })
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'teamcity',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_template.test.ts b/test/providers/provider_template.test.ts
index 416af1e..4080861 100644
--- a/test/providers/provider_template.test.ts
+++ b/test/providers/provider_template.test.ts
@@ -1,6 +1,6 @@
 import td from 'testdouble'
 import childProcess from 'child_process'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 /*
 Add your provider here and name it provder<Ci>. Example:
@@ -42,13 +42,13 @@ describe('<Ci> Params', () => {
       args: { tag: '', url: '', source: '', flags: '' },
       envs: {},
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '',
       buildURL: '',
       commit: '',
       job: '',
-      pr: '',
+      pr: 0,
       service: '',
       slug: '',
     }
@@ -64,13 +64,13 @@ describe('<Ci> Params', () => {
       args: { tag: '', url: '', source: '', flags: '' },
       envs: {},
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '',
       buildURL: '',
       commit: '',
       job: '',
-      pr: '',
+      pr: 0,
       service: '',
       slug: '',
     }
@@ -91,13 +91,13 @@ describe('<Ci> Params', () => {
       },
       envs: {},
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '',
       buildURL: '',
       commit: '',
       job: '',
-      pr: '',
+      pr: 0,
       service: '',
       slug: '',
     }
@@ -118,13 +118,13 @@ describe('<Ci> Params', () => {
       },
       envs: {},
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '',
       buildURL: '',
       commit: '',
       job: '',
-      pr: '',
+      pr: 0,
       service: '',
       slug: '',
     }
diff --git a/test/providers/provider_travisci.test.ts b/test/providers/provider_travisci.test.ts
index dbd124c..846f076 100644
--- a/test/providers/provider_travisci.test.ts
+++ b/test/providers/provider_travisci.test.ts
@@ -1,7 +1,7 @@
 import td from 'testdouble'
 
 import * as providerTravisci from '../../src/ci_providers/provider_travisci'
-import { UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderInputs } from '../../src/types'
 
 describe('TravisCI Params', () => {
   afterEach(() => {
@@ -66,13 +66,13 @@ describe('TravisCI Params', () => {
         TRAVIS_REPO_SLUG: 'testOrg/testRepo',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: '',
       build: '1',
       buildURL: '',
       commit: 'testingsha',
       job: '2',
-      pr: '',
+      pr: 0,
       service: 'travis',
       slug: 'testOrg/testRepo',
     }
@@ -103,13 +103,13 @@ describe('TravisCI Params', () => {
         TRAVIS_TAG: 'main',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '1',
       buildURL: '',
       commit: 'testingprsha',
       job: '2',
-      pr: '',
+      pr: 0,
       service: 'travis',
       slug: 'testOrg/testRepo',
     }
@@ -139,13 +139,13 @@ describe('TravisCI Params', () => {
         TRAVIS_TAG: 'main',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '1',
       buildURL: '',
       commit: 'testingprsha',
       job: '2',
-      pr: '',
+      pr: 0,
       service: 'travis',
       slug: 'testOrg/testRepo',
     }
@@ -172,13 +172,13 @@ describe('TravisCI Params', () => {
         TRAVIS: 'true',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: '',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'travis',
       slug: 'testOrg/testRepo',
     }
diff --git a/test/providers/provider_wercker.test.ts b/test/providers/provider_wercker.test.ts
index d416e18..1876ab7 100644
--- a/test/providers/provider_wercker.test.ts
+++ b/test/providers/provider_wercker.test.ts
@@ -1,7 +1,7 @@
 import td from 'testdouble'
 
 import * as providerWercker from '../../src/ci_providers/provider_wercker'
-import { UploaderArgs, UploaderInputs } from '../../src/types'
+import { IServiceParams, UploaderArgs, UploaderInputs } from '../../src/types'
 
 describe('Wercker CI Params', () => {
   afterEach(() => {
@@ -53,13 +53,13 @@ describe('Wercker CI Params', () => {
         WERCKER_BUILD_URL: 'https://example.com/build',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'main',
       build: '1',
       buildURL: 'https://example.com/build',
       commit: 'testingsha',
       job: '',
-      pr: '',
+      pr: 0,
       service: 'wercker',
       slug: 'testOrg/testRepo',
     }
@@ -90,13 +90,13 @@ describe('Wercker CI Params', () => {
         WERCKER_BUILD_URL: 'https://example.com/build',
       },
     }
-    const expected = {
+    const expected: IServiceParams = {
       branch: 'branch',
       build: '3',
       buildURL: 'https://example.com/build',
       commit: 'testsha',
       job: '',
-      pr: '2',
+      pr: 2,
       service: 'wercker',
       slug: 'testOrg/testRepo',
     }