mirror of
https://github.com/stCarolas/setup-maven.git
synced 2025-02-26 09:42:28 +00:00
17 lines
436 B
TypeScript
17 lines
436 B
TypeScript
![]() |
import * as path from 'path';
|
||
|
|
||
|
import { getVersionFromToolcachePath } from '../src/utils';
|
||
|
|
||
|
describe('getVersionFromToolcachePath', () => {
|
||
|
it.each([
|
||
|
['', ''],
|
||
|
['foo', '.'],
|
||
|
[path.join('foo', '1.0', 'x64'), '1.0'],
|
||
|
[`bar${path.sep}foo${path.sep}`, 'bar']
|
||
|
])('%s -> %s', (toolPath: string, expected: string) => {
|
||
|
const actual = getVersionFromToolcachePath(toolPath);
|
||
|
|
||
|
expect(actual).toBe(expected);
|
||
|
});
|
||
|
});
|