mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-02-04 02:43:19 +08:00
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'
This commit is contained in:
25
src/model/unity-version-parser.test.ts
Normal file
25
src/model/unity-version-parser.test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import UnityVersionParser from './unity-version-parser';
|
||||
|
||||
describe('UnityVersionParser', () => {
|
||||
describe('parse', () => {
|
||||
it('throws for empty string', () => {
|
||||
expect(() => UnityVersionParser.parse('')).toThrow(Error);
|
||||
});
|
||||
|
||||
it('parses from ProjectVersion.txt', () => {
|
||||
const projectVersionContents = `m_EditorVersion: 2019.2.11f1
|
||||
m_EditorVersionWithRevision: 2019.2.11f1 (5f859a4cfee5)`;
|
||||
expect(UnityVersionParser.parse(projectVersionContents)).toBe('2019.2.11f1');
|
||||
});
|
||||
});
|
||||
|
||||
describe('read', () => {
|
||||
it('throws for invalid path', () => {
|
||||
expect(() => UnityVersionParser.read('')).toThrow(Error);
|
||||
});
|
||||
|
||||
it('reads from unity-project-with-correct-tests', () => {
|
||||
expect(UnityVersionParser.read('./unity-project-with-correct-tests')).toBe('2019.2.11f1');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user