Skip to content

Commit

Permalink
chore: convert autop tests to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
jpstevens committed May 10, 2024
1 parent 0a30a5a commit 670dd21
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import { autop, removep } from '../';
import { autop, removep } from '..';

test( 'empty string', () => {
expect( autop( '' ) ).toBe( '' );
Expand Down Expand Up @@ -311,7 +311,7 @@ test( 'that_autop_treats_block_level_elements_as_blocks', () => {
];

// Check whitespace normalization.
let content = [];
let content: string[] = [];

blocks.forEach( ( block ) => {
content.push( `<${ block }>foo</${ block }>` );
Expand Down Expand Up @@ -388,18 +388,18 @@ test( 'that autop treats inline elements as inline', () => {
'select',
];

let content = [];
let expected = [];
const content: string[] = [];
const expected: string[] = [];

inlines.forEach( ( inline ) => {
content.push( `<${ inline }>foo</${ inline }>` );
expected.push( `<p><${ inline }>foo</${ inline }></p>` );
} );

content = content.join( '\n\n' );
expected = expected.join( '\n' );
const contentString = content.join( '\n\n' );
const expectedString = expected.join( '\n' );

expect( autop( content ).trim() ).toBe( expected );
expect( autop( contentString ).trim() ).toBe( expectedString );
} );

test( 'element sanity', () => {
Expand Down

0 comments on commit 670dd21

Please sign in to comment.