Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
alkoleft committed Sep 17, 2024
1 parent a6175cc commit 9fe036a
Show file tree
Hide file tree
Showing 16 changed files with 693 additions and 676 deletions.
25 changes: 3 additions & 22 deletions __tests__/installer.test.ts → __tests__/edt.installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,13 @@
*/

import * as core from '@actions/core'
import * as installer from '../src/installer'
import installer from '../src/installers/edt'

// Mock the GitHub Actions core library
const debugMock = jest.spyOn(core, 'debug')
const getInputMock = jest.spyOn(core, 'getInput')
const getBooleanInput = jest.spyOn(core, 'getBooleanInput')
const setFailedMock = jest.spyOn(core, 'setFailed')
const setOutputMock = jest.spyOn(core, 'setOutput')

// Mock the action's entrypoint
const runMock = jest.spyOn(installer, 'run')

// Other utilities
const timeRegex = /^\d{2}:\d{2}:\d{2}/
const TIMEOUT = 50000

// interface Input {
// type?: 'edt'|'onec',
// edt_version?: string,
// onec_version?: string,
// cache?: boolean,
// cache_distr?: boolean
// }

type Input = { [key: string]: string }

describe('action', () => {
Expand All @@ -52,8 +35,7 @@ describe('action', () => {
'Download EDT',
async () => {
const input: Input = {
type: 'edt',
edt_version: '2023.1.2',
version: '2023.1.2',
offline: 'true'
}
new Map()
Expand All @@ -65,8 +47,7 @@ describe('action', () => {
return input[name] === 'true'
})

await installer.run()
expect(runMock).toHaveReturned()
await installer()
},
TIMEOUT
)
Expand Down
89 changes: 0 additions & 89 deletions __tests__/main.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions __tests__/wait.test.ts

This file was deleted.

Loading

0 comments on commit 9fe036a

Please sign in to comment.