mirror of
https://github.com/game-ci/unity-test-runner.git
synced 2026-02-03 10:19:08 +08:00
* Support new unity versioning scheme with regex matching groups * Update github action packages * Pin windows runner image version to 2022. Fix artifact name. Remove max-parallel cap for tests
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
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: 2022.3.7f1
|
|
m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0)`;
|
|
expect(UnityVersionParser.parse(projectVersionContents)).toBe('2022.3.7f1');
|
|
});
|
|
|
|
it('parses Unity 6000 and newer from ProjectVersion.txt', () => {
|
|
const projectVersionContents = `m_EditorVersion: 6000.0.0f1
|
|
m_EditorVersionWithRevision: 6000.0.0f1 (cb45f9cae8b7)`;
|
|
expect(UnityVersionParser.parse(projectVersionContents)).toBe('6000.0.0f1');
|
|
});
|
|
});
|
|
|
|
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('2022.3.7f1');
|
|
});
|
|
});
|
|
});
|