Files
unity-test-runner/src/model/input.test.ts
David Finol cdfccd0aad Refactor to typescript (#158)
* Refactor to typescript

* Fix platform and workflow

* Fix workflow and platform

* Update husky and image-tag

* Use 'yarn lint-staged' instead of 'npx lint-staged'
2022-01-11 05:52:29 -06:00

37 lines
873 B
TypeScript

import Input from './input';
jest.mock('./unity-version-parser');
describe('Input', () => {
describe('getFromUser', () => {
it('does not throw', () => {
expect(() => Input.getFromUser()).not.toThrow();
});
it('returns an object', () => {
expect(typeof Input.getFromUser()).toStrictEqual('object');
});
});
describe('isValidFolderName', () => {
test.each([
'.',
'./',
'folder',
'trailing/',
'.hidden',
'.hidden/sub',
'.hidden/trailing/',
'./.hidden-sub',
'hyphen-folder',
'under_score',
])('returns true for %s', folderName => {
expect(Input.isValidFolderName(folderName)).toStrictEqual(true);
});
test.each(['..', '../'])('returns false for %s', folderName => {
expect(Input.isValidFolderName(folderName)).toStrictEqual(false);
});
});
});