Add mocks to tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Inputs } from "./Inputs";
|
||||
import { Releases } from "./Releases";
|
||||
import { basename } from "path";
|
||||
|
||||
export class Action {
|
||||
private inputs: Inputs
|
||||
@@ -9,4 +10,22 @@ export class Action {
|
||||
this.inputs = inputs
|
||||
this.releases = releases
|
||||
}
|
||||
|
||||
async perform() {
|
||||
const createResult = await this.releases.create(
|
||||
this.inputs.tag,
|
||||
this.inputs.body,
|
||||
this.inputs.commit,
|
||||
this.inputs.draft,
|
||||
this.inputs.name)
|
||||
|
||||
if (this.inputs.artifact) {
|
||||
await this.releases.uploadArtifact(
|
||||
createResult.data.assets_url,
|
||||
this.inputs.artifactContentLength,
|
||||
this.inputs.artifactContentType,
|
||||
this.inputs.artifact,
|
||||
basename(this.inputs.artifact))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user