Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Improve test to match exactly thrown error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed May 16, 2019
1 parent d6f11bf commit e75dfde
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/decouplededitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,19 @@ describe( 'DecoupledEditor', () => {
DecoupledEditor.create( '<p>Hello world!</p>', {
initialData: '<p>I am evil!</p>',
plugins: [ Paragraph ]
} ).catch( () => {
done();
} );
} )
.then(
() => {
expect.fail( 'Decoupled editor should throw an error when both initial data are passed' );
},
err => {
expect( err ).to.be.an( 'error' ).with.property( 'message' ).and
// eslint-disable-next-line max-len
.match( /^editor-create-initial-data: The config\.initialData option cannot be used together with initial data passed in Editor\.create\(\)\./ );
}
)
.then( done )
.catch( done );
} );

it( 'throws error if it is initialized in textarea', done => {
Expand Down

0 comments on commit e75dfde

Please sign in to comment.