mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-17 18:35:07 +00:00
29 lines
621 B
TypeScript
29 lines
621 B
TypeScript
import {sep} from 'path'
|
|
import {get_first_part, get_second_part} from '../src/partial'
|
|
|
|
function test_get_first_part(
|
|
input: string,
|
|
separator: string,
|
|
expected: string
|
|
) {
|
|
let actual = get_first_part(input, separator)
|
|
expect(actual).toEqual(expected)
|
|
}
|
|
|
|
function test_get_second_part(
|
|
input: string,
|
|
separator: string,
|
|
expected: string
|
|
) {
|
|
let actual = get_second_part(input, separator)
|
|
expect(actual).toEqual(expected)
|
|
}
|
|
|
|
test('get_first_part', () => {
|
|
test_get_first_part('first/second', '/', 'first')
|
|
})
|
|
|
|
test('get_second_part', () => {
|
|
test_get_second_part('first/second', '/', 'second')
|
|
})
|