Skip to content

Commit

Permalink
Remove the PackageManager enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Sep 20, 2021
1 parent 10f6585 commit ab093d5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions __tests__/dependabot-api.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {APIClient, PackageManager} from '../src/api-client'
import {APIClient} from '../src/api-client'

describe('APIClient', () => {
const mockAxios: any = {
Expand Down Expand Up @@ -34,6 +34,6 @@ describe('APIClient', () => {

const jobDetails = await api.getJobDetails()
expect(jobDetails['allowed-updates'].length).toBe(1)
expect(jobDetails['package-manager']).toBe(PackageManager.NpmAndYarn)
expect(jobDetails['package-manager']).toBe('npm_and_yarn')
})
})
4 changes: 2 additions & 2 deletions __tests__/proxy-integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Docker from 'dockerode'
import {Credential, JobDetails, PackageManager} from '../src/api-client'
import {Credential, JobDetails} from '../src/api-client'
import {ImageService} from '../src/image-service'
import {PROXY_IMAGE_NAME} from '../src/main'
import {ProxyBuilder} from '../src/proxy'
Expand All @@ -17,7 +17,7 @@ describe('ProxyBuilder', () => {
'dependency-type': 'all'
}
],
'package-manager': PackageManager.NpmAndYarn
'package-manager': 'npm_and_yarn'
}
const credentials: Credential[] = [
{
Expand Down
4 changes: 2 additions & 2 deletions __tests__/updater.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {UPDATER_IMAGE_NAME, PROXY_IMAGE_NAME} from '../src/main'
import {Updater} from '../src/updater'
import {PackageManager} from '../src/api-client'

describe('Updater', () => {
const mockAPIClient: any = {
Expand All @@ -13,14 +12,15 @@ describe('Updater', () => {
dependabotApiUrl: 'http://host.docker.internal:3001'
}
}

const mockJobDetails: any = {
id: '1',
'allowed-updates': [
{
'dependency-type': 'all'
}
],
'package-manage': PackageManager.NpmAndYarn
'package-manager': 'npm-and-yarn'
}

const updater = new Updater(
Expand Down
8 changes: 1 addition & 7 deletions src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ export class JobParameters {
) {}
}

// TODO: Populate with enabled values
// TODO: Rescue unsupported values
export enum PackageManager {
NpmAndYarn = 'npm_and_yarn'
}

// JobDetails are information about the repository and dependencies to be updated
export type JobDetails = {
'allowed-updates': {
'dependency-type': string
}[]
id: string
'package-manager': PackageManager
'package-manager': string
}

export type JobError = {
Expand Down

0 comments on commit ab093d5

Please sign in to comment.