generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix defaulting and adjust defaults in action.yaml * Changelog and package updates
- Loading branch information
Showing
10 changed files
with
134 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {parseLabels} from '../src/label-extractor' | ||
|
||
test('parseLabels should return an empty array when given an empty string', () => { | ||
const labelsString = '' | ||
const result = parseLabels(labelsString) | ||
expect(result).toEqual([]) | ||
}) | ||
|
||
test('parseLabels should correctly parse a single label', () => { | ||
const labelsString = 'label1' | ||
const result = parseLabels(labelsString) | ||
expect(result).toEqual(['label1']) | ||
}) | ||
|
||
test('parseLabels should correctly parse multiple labels separated by commas', () => { | ||
const labelsString = 'label1, label2, label3' | ||
const result = parseLabels(labelsString) | ||
expect(result).toEqual(['label1', 'label2', 'label3']) | ||
}) | ||
|
||
test('parseLabels should correctly parse labels with special characters', () => { | ||
const labelsString = | ||
'label1, label-with-dashes, label+with+plus, label?with?question, label;with;semicolon, label[with]brackets, label(with)parenthesis, label/with/forward-slashes' | ||
const result = parseLabels(labelsString) | ||
expect(result).toEqual([ | ||
'label1', | ||
'label-with-dashes', | ||
'label+with+plus', | ||
'label?with?question', | ||
'label;with;semicolon', | ||
'label[with]brackets', | ||
'label(with)parenthesis', | ||
'label/with/forward-slashes' | ||
]) | ||
}) | ||
|
||
test('parseLabels should ignore leading and trailing whitespace', () => { | ||
const labelsString = ' label1 , label2 , label3 ' | ||
const result = parseLabels(labelsString) | ||
expect(result).toEqual(['label1', 'label2', 'label3']) | ||
}) | ||
|
||
test('parseLabels should ignore empty labels', () => { | ||
const labelsString = 'label1, , label2, , label3' | ||
const result = parseLabels(labelsString) | ||
expect(result).toEqual(['label1', 'label2', 'label3']) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters