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

Commit

Permalink
test: rename assertion methods
Browse files Browse the repository at this point in the history
The `t.same()` and `t.ok` methods have been deprecated.
  • Loading branch information
blond committed Apr 18, 2016
1 parent 7716074 commit 9864b30
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ module.exports = class BemEntity {
valueOf() { return this._obj; }

/**
* Determines whether specified entity is the same entity.
* Determines whether specified entity is the deepEqual entity.
*
* @param {object} entity - the entity to compare.
*
* @returns {boolean} A Boolean indicating whether or not specified entity is the same entity.
* @returns {boolean} A Boolean indicating whether or not specified entity is the deepEqual entity.
*/
is(entity) {
return entity && (this.id === entity.id);
Expand Down
2 changes: 1 addition & 1 deletion test/fields.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ test('should provide `elem` field', t => {
test('should provide `mod` field', t => {
const entity = new BemEntity({ block: 'block', mod: { name: 'mod', val: 'val' } });

t.same(entity.mod, { name: 'mod', val: 'val' });
t.deepEqual(entity.mod, { name: 'mod', val: 'val' });
});
2 changes: 1 addition & 1 deletion test/normalize.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('should normalize short entry for boolean modifier', t => {
test('should support `modName` and `modVal` fields', t => {
const entity = new BemEntity({ block: 'block', modName: 'mod', modVal: 'val' });

t.same(entity.mod, { name: 'mod', val: 'val' });
t.deepEqual(entity.mod, { name: 'mod', val: 'val' });
});

test('should use `mod.name` field instead of `modName`', t => {
Expand Down
8 changes: 4 additions & 4 deletions test/to-string.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ test('should use `naming.stringify()` for block', t => {

entity.toString();

t.ok(spy.calledWith({ block: 'block' }));
t.truthy(spy.calledWith({ block: 'block' }));
});

test('should use `naming.stringify()` for elem', t => {
const entity = new BemEntity({ block: 'block', elem: 'elem' });

entity.toString();

t.ok(spy.calledWith({ block: 'block', elem: 'elem' }));
t.truthy(spy.calledWith({ block: 'block', elem: 'elem' }));
});

test('should use `naming.stringify()` for block modifier', t => {
const entity = new BemEntity({ block: 'block', modName: 'mod', modVal: 'val' });

entity.toString();

t.ok(spy.calledWith({ block: 'block', modName: 'mod', modVal: 'val' }));
t.truthy(spy.calledWith({ block: 'block', modName: 'mod', modVal: 'val' }));
});

test('should use naming.stringify() for element modifier', t => {
const entity = new BemEntity({ block: 'block', elem: 'elem', modName: 'mod', modVal: 'val' });

entity.toString();

t.ok(spy.calledWith({ block: 'block', elem: 'elem', modName: 'mod', modVal: 'val' }));
t.truthy(spy.calledWith({ block: 'block', elem: 'elem', modName: 'mod', modVal: 'val' }));
});
8 changes: 4 additions & 4 deletions test/type.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('should use `naming.typeOf()` for block', t => {
/*eslint no-unused-expressions: "off"*/
entity.type;

t.ok(spy.calledWith({ block: 'block' }));
t.truthy(spy.calledWith({ block: 'block' }));
});

test('should use `naming.typeOf()` for elem', t => {
Expand All @@ -24,7 +24,7 @@ test('should use `naming.typeOf()` for elem', t => {
/*eslint no-unused-expressions: "off"*/
entity.type;

t.ok(spy.calledWith({ block: 'block', elem: 'elem' }));
t.truthy(spy.calledWith({ block: 'block', elem: 'elem' }));
});

test('should use `naming.typeOf()` for block modifier', t => {
Expand All @@ -33,7 +33,7 @@ test('should use `naming.typeOf()` for block modifier', t => {
/*eslint no-unused-expressions: "off"*/
entity.type;

t.ok(spy.calledWith({ block: 'block', modName: 'mod', modVal: 'val' }));
t.truthy(spy.calledWith({ block: 'block', modName: 'mod', modVal: 'val' }));
});

test('should use naming.typeOf() for element modifier', t => {
Expand All @@ -42,5 +42,5 @@ test('should use naming.typeOf() for element modifier', t => {
/*eslint no-unused-expressions: "off"*/
entity.type;

t.ok(spy.calledWith({ block: 'block', elem: 'elem', modName: 'mod', modVal: 'val' }));
t.truthy(spy.calledWith({ block: 'block', elem: 'elem', modName: 'mod', modVal: 'val' }));
});
2 changes: 1 addition & 1 deletion test/value-of.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ test('should return entity object', t => {
const obj = { block: 'block' };
const entity = new BemEntity(obj);

t.same(entity.valueOf(), obj);
t.deepEqual(entity.valueOf(), obj);
});

0 comments on commit 9864b30

Please sign in to comment.