mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-05-17 18:35:07 +00:00
BREAKING CHANGE: The action implementation move from container action to node.js action Co-authored-by: Romain Lespinasse <romain.lespinasse@gmail.com>
38 lines
883 B
TypeScript
38 lines
883 B
TypeScript
import {slugurl} from '../src/slug'
|
|
|
|
function test_slug_url(input: string, expected: string) {
|
|
let actual = slugurl(input)
|
|
expect(actual).toEqual(expected)
|
|
}
|
|
|
|
test('slug_url: a word', () => {
|
|
test_slug_url('word', 'word')
|
|
})
|
|
|
|
test('slug_url: a string', () => {
|
|
test_slug_url('basic-string', 'basic-string')
|
|
})
|
|
|
|
test('slug_url: a string in camel case', () => {
|
|
test_slug_url('camelCase', 'camelcase')
|
|
})
|
|
|
|
test('slug_url: a path', () => {
|
|
test_slug_url('path/to/something', 'path-to-something')
|
|
})
|
|
|
|
test('slug_url: a number', () => {
|
|
test_slug_url('4.2', '4-2')
|
|
})
|
|
|
|
test('slug_url: trailing', () => {
|
|
test_slug_url('.path.to.', 'path-to')
|
|
})
|
|
|
|
test('slug_url: a very long string', () => {
|
|
test_slug_url(
|
|
'an-awesome-Feature-Very-Very-Very-Very-Very-Very-Very-Long-moreThan63Characters',
|
|
'an-awesome-feature-very-very-very-very-very-very-very-long-more'
|
|
)
|
|
})
|