This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new strip spaces + fix filterAlphaNumericPlus
- Loading branch information
Showing
9 changed files
with
61 additions
and
11 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
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { filterAlphaNumericPlus, removeAllSpaces } from '../src/utilities/string'; | ||
|
||
test('test to check alpha + numeric filter works', () => { | ||
const filtered = filterAlphaNumericPlus(' foo 123 bar #!$%&/()? baz '); | ||
expect(filtered).toBe('foo123barbaz') | ||
}); | ||
|
||
test('test to check alpha + numeric plus filter works', () => { | ||
const filtered = filterAlphaNumericPlus(' foo bar !$% baz ', '!$%'); | ||
expect(filtered).toBe('foobar!$%baz') | ||
}); | ||
|
||
test('test to check alpha + numeric filter works accepts space as specialcharacter that shouldnt get filtered', () => { | ||
const filtered = filterAlphaNumericPlus(' foo bar #!$%&/()? baz ', ' '); | ||
expect(filtered).toBe(' foo bar baz ') | ||
}); | ||
|
||
test('test to check if removing spaces works', () => { | ||
const noSpacesString = removeAllSpaces(' foo bar baz '); | ||
expect(noSpacesString).toBe('foobarbaz') | ||
}); |