Files
github-slug-action/__tests__/slugurl.test.ts
Antoine Méausoone 13c2f38dad feat: add support for windows and macos jobs
BREAKING CHANGE: The action implementation move from container action to node.js action

Co-authored-by: Romain Lespinasse <romain.lespinasse@gmail.com>
2020-09-26 09:07:49 +02:00

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'
)
})