Skip to content

Commit 31eed03

Browse files
committed
fix(shape): Fix issue with export default class
1 parent cbca81a commit 31eed03

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Basic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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);

test/unit/Basic.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { assert } from 'chai';
22
import sinon from 'sinon';
3-
import { Shape } from '../../src/Basic';
3+
import Shape from '../../src/Basic';
44

55
describe('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', () => {

0 commit comments

Comments
 (0)