-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from getappmap/feat/add-issue-parameter
If we pass an issue number to the action use it in the analysis
- Loading branch information
Showing
6 changed files
with
82 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { parseIssueNumber } from '../src/analyze'; | ||
|
||
describe('parseIssueNumber', () => { | ||
it('should return an integer when an integer is provided', () => { | ||
expect(parseIssueNumber(123)).toEqual(123); | ||
}); | ||
|
||
it('should return an integer when a numeric string is provided', () => { | ||
expect(parseIssueNumber('123')).toEqual(123); | ||
}); | ||
|
||
it('should return undefined when a non-numeric string is provided', () => { | ||
expect(parseIssueNumber('abc')).toBeUndefined(); | ||
}); | ||
|
||
it('should return undefined when an empty string is provided', () => { | ||
expect(parseIssueNumber('')).toBeUndefined(); | ||
}); | ||
|
||
it('should return undefined when a string with spaces is provided', () => { | ||
expect(parseIssueNumber(' ')).toBeUndefined(); | ||
}); | ||
|
||
it('should return undefined when a null value is provided', () => { | ||
expect(parseIssueNumber(null)).toBeUndefined(); | ||
}); | ||
|
||
it('should return undefined when an undefined value is provided', () => { | ||
expect(parseIssueNumber(undefined)).toBeUndefined(); | ||
}); | ||
|
||
it('should return undefined when a boolean value is provided', () => { | ||
expect(parseIssueNumber(true)).toBeUndefined(); | ||
expect(parseIssueNumber(false)).toBeUndefined(); | ||
}); | ||
|
||
it('should return the integer part when a string with a number and letters is provided', () => { | ||
expect(parseIssueNumber('123abc')).toEqual(123); | ||
}); | ||
}); |