File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 * }
1818 * }
1919 */
20- export class Shape {
20+ export default class Shape {
2121 _text = '' ;
2222 _width = 15 ;
2323 _height = 5 ;
@@ -233,7 +233,7 @@ export class Shape {
233233 * @returns {Shape }
234234 */
235235 static fromObject ( obj ) {
236- if ( ! obj . name || ! obj . options ) throw new Error ( 'It looks like it is not an Object representation of the Shape ' ) ;
236+ if ( ! obj . name || ! obj . options ) throw new Error ( 'It looks like it is not an Object representation of the shape ' ) ;
237237 if ( obj . name !== this . name ) throw new Error ( `${ obj . name } is not an Object representation of the ${ this . name } ` ) ;
238238
239239 return this . create ( obj . options ) ;
Original file line number Diff line number Diff line change 11import { assert } from 'chai' ;
22import sinon from 'sinon' ;
3- import { Shape } from '../../src/Basic' ;
3+ import Shape from '../../src/Basic' ;
44
55describe ( 'Shape' , ( ) => {
66 it ( 'Should properly initialize shape instance with no arguments' , ( ) => {
@@ -119,7 +119,7 @@ describe('Shape', () => {
119119
120120 it ( 'Should properly throw error if trying to create Shape not from Object representation' , ( ) => {
121121 let obj = { } ;
122- assert . throws ( ( ) => Shape . fromObject ( obj ) , Error , 'It looks like it is not an Object representation of the Shape ' ) ;
122+ assert . throws ( ( ) => Shape . fromObject ( obj ) , Error , 'It looks like it is not an Object representation of the shape ' ) ;
123123 } ) ;
124124
125125 it ( 'Should properly throw error if trying to create Shape not from its representation' , ( ) => {
You can’t perform that action at this time.
0 commit comments