mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-04 21:20:15 -07:00
28 lines
692 B
JavaScript
28 lines
692 B
JavaScript
import Input from './input';
|
|
import Versioning from './versioning';
|
|
|
|
const determineVersion = jest
|
|
.spyOn(Versioning, 'determineVersion')
|
|
.mockImplementation(() => '1.3.37');
|
|
|
|
afterEach(() => {
|
|
jest.clearAllMocks();
|
|
});
|
|
|
|
describe('Input', () => {
|
|
describe('getFromUser', () => {
|
|
it('does not throw', async () => {
|
|
await expect(Input.getFromUser()).resolves.not.toBeNull();
|
|
});
|
|
|
|
it('returns an object', async () => {
|
|
await expect(typeof (await Input.getFromUser())).toStrictEqual('object');
|
|
});
|
|
|
|
it('calls version generator once', async () => {
|
|
await Input.getFromUser();
|
|
expect(determineVersion).toHaveBeenCalledTimes(1);
|
|
});
|
|
});
|
|
});
|