Skip to content

Commit

Permalink
Tests: Raw Handling: Error if missing fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsf committed Nov 19, 2019
1 parent 0d1b0e8 commit 9a1848b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/integration/blocks-raw-handling.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,17 @@ describe( 'Blocks raw handling', () => {
'markdown',
'wordpress',
'gutenberg',
'caption-shortcode',
'shortcode-matching',
].forEach( ( type ) => {
it( type, () => {
const HTML = readFile( path.join( __dirname, `fixtures/${ type }-in.html` ) );
const plainText = readFile( path.join( __dirname, `fixtures/${ type }-in.txt` ) );
const output = readFile( path.join( __dirname, `fixtures/${ type }-out.html` ) );

if ( ! ( HTML || plainText ) || ! output ) {
throw new Error( `Expected fixtures for type ${ type }` );
}

const converted = pasteHandler( { HTML, plainText, canUserUseUnfilteredHTML: true } );
const serialized = typeof converted === 'string' ? converted : serialize( converted );

Expand Down

0 comments on commit 9a1848b

Please sign in to comment.