Skip to content
This repository was archived by the owner on Feb 4, 2018. It is now read-only.

Commit 0849fbc

Browse files
author
blond
committed
refactor(TypeError): fix error message
1 parent ffce876 commit 0849fbc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class EntityTypeError extends ExtendableError {
2727
*/
2828
constructor(obj, reason) {
2929
const str = util.inspect(obj, { depth: 1 });
30-
const message = `The object \`${str}\` is not valid BEM entity`;
30+
const message = `the object \`${str}\` is not valid BEM entity`;
3131

32-
super(reason ? `${message}: ${reason}` : message);
32+
super(reason ? `${message}, ${reason}` : message);
3333
}
3434
}
3535

test/construct.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ test('should create object and normalize boolean modifier', t => {
2929
test('should throw error for if entity object is not valid', t => {
3030
t.throws(
3131
() => new BemEntityName({ elem: 'elem' }),
32-
"The object `{ elem: 'elem' }` is not valid BEM entity: the field `block` is undefined"
32+
"the object `{ elem: 'elem' }` is not valid BEM entity, the field `block` is undefined"
3333
);
3434
});
3535

3636
test('should throw error for if mod object is empty', t => {
3737
t.throws(
3838
() => new BemEntityName({ block: 'block', mod: {} }),
39-
"The object `{ block: 'block', mod: {} }` is not valid BEM entity: the field `mod.name` is undefined"
39+
"the object `{ block: 'block', mod: {} }` is not valid BEM entity, the field `mod.name` is undefined"
4040
);
4141
});
4242

4343
test('should throw error for if mod name is undefined', t => {
4444
t.throws(
4545
() => new BemEntityName({ block: 'block', mod: { val: 'val' } }),
46-
"The object `{ block: 'block', mod: { val: 'val' } }` is not valid BEM entity: the field `mod.name` is undefined"
46+
"the object `{ block: 'block', mod: { val: 'val' } }` is not valid BEM entity, the field `mod.name` is undefined"
4747
);
4848
});

0 commit comments

Comments
 (0)