mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-17 18:35:07 +00:00
feat: support partial GITHUB_REPOSITORY
This commit is contained in:
committed by
Romain Lespinasse
parent
49e1056c70
commit
75ce03b6a0
28
__tests__/partial.test.ts
Normal file
28
__tests__/partial.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
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')
|
||||
})
|
||||
Reference in New Issue
Block a user