11import { parseString , WhitespaceHandling } from './wordList' ;
22
3- interface ITestCase {
3+ interface TestCase {
44 delimiter : string ;
55 inputString : string ;
66}
@@ -9,7 +9,7 @@ const { Preserve, TrimLeadingAndTrailing } = WhitespaceHandling;
99
1010describe ( 'parseString' , ( ) => {
1111 it ( 'returns an empty array when input string is empty' , ( ) => {
12- function testInput ( input : string ) {
12+ function testInput ( input : string ) : void {
1313 const wordList = parseString ( input , ',' , Preserve ) ;
1414 expect ( wordList ) . toEqual ( [ ] ) ;
1515 }
@@ -18,7 +18,7 @@ describe('parseString', () => {
1818 } ) ;
1919
2020 it ( 'returns entire input string in array when delimiter is empty' , ( ) => {
21- function testDelimiter ( delimiter : string ) {
21+ function testDelimiter ( delimiter : string ) : void {
2222 const wordList = parseString ( ' some input string ' , delimiter , Preserve ) ;
2323 expect ( wordList ) . toEqual ( [ ' some input string ' ] ) ;
2424 }
@@ -27,7 +27,7 @@ describe('parseString', () => {
2727 } ) ;
2828
2929 it ( 'returns entire input string in array when delimiter is not present in input string' , ( ) => {
30- function testDelimiter ( delimiter : string ) {
30+ function testDelimiter ( delimiter : string ) : void {
3131 const wordList = parseString ( ' some input string ' , delimiter , Preserve ) ;
3232 expect ( wordList ) . toEqual ( [ ' some input string ' ] ) ;
3333 }
@@ -37,13 +37,13 @@ describe('parseString', () => {
3737
3838 it ( 'splits input string by delimiter' , ( ) => {
3939 const expectedResult = [ 'foo' , 'Bar' , ' b@z ' ] ;
40- const testCases : ITestCase [ ] = [
40+ const testCases : TestCase [ ] = [
4141 { delimiter : ',' , inputString : 'foo,Bar, b@z ' } ,
4242 { delimiter : '\t' , inputString : 'foo Bar b@z ' } ,
4343 { delimiter : 'aaa' , inputString : 'fooaaaBaraaa b@z ' } ,
4444 ] ;
4545
46- function testSplit ( { delimiter, inputString } : ITestCase ) {
46+ function testSplit ( { delimiter, inputString } : TestCase ) : void {
4747 const wordList = parseString ( inputString , delimiter , Preserve ) ;
4848 expect ( wordList ) . toEqual ( expectedResult ) ;
4949 }
@@ -53,12 +53,12 @@ describe('parseString', () => {
5353
5454 it ( 'splits input string by whitespace delimiter' , ( ) => {
5555 const expectedResult = [ 'foo' , 'Bar' , 'b@z' , '' ] ;
56- const testCases : ITestCase [ ] = [
56+ const testCases : TestCase [ ] = [
5757 { delimiter : ' ' , inputString : 'foo Bar b@z ' } ,
5858 { delimiter : ' ' , inputString : 'foo Bar b@z ' } ,
5959 ] ;
6060
61- function testSplit ( { delimiter, inputString } : ITestCase ) {
61+ function testSplit ( { delimiter, inputString } : TestCase ) : void {
6262 const wordList = parseString ( inputString , delimiter , Preserve ) ;
6363 expect ( wordList ) . toEqual ( expectedResult ) ;
6464 }
0 commit comments