Files
release-action/__tests__/Inputs.test.ts
2019-08-26 12:15:12 -04:00

23 lines
546 B
TypeScript

const mockGetInput = jest.fn();
import { Inputs } from "../src/Inputs";
import { Context } from "@actions/github/lib/context";
jest.mock('@actions/core', () => {
return {getInput: mockGetInput};
});
describe('Inputs', () => {
let context: Context
let inputs: Inputs
beforeEach(() => {
context = new Context()
inputs = new Inputs(context)
mockGetInput.mockReturnValue("")
})
it('returns token', () => {
mockGetInput.mockReturnValue("42")
expect(inputs.token).toBe("42")
})
})