diff --git a/test/unit/api/search.spec.js b/test/unit/api/search.spec.js index 43cc61cb9..602d565d5 100644 --- a/test/unit/api/search.spec.js +++ b/test/unit/api/search.spec.js @@ -1,4 +1,3 @@ -import assert from 'assert'; import Search from '../../../src/lib/search'; import Config from '../../../src/lib/config'; import Storage from '../../../src/lib/storage'; @@ -45,7 +44,7 @@ describe('search', () => { test('search query item', () => { let result = Search.query('t'); - assert(result.length === 3); + expect(result).toHaveLength(3); }); test('search remove item', () => { @@ -58,9 +57,9 @@ describe('search', () => { }; Search.add(item); let result = Search.query('test6'); - assert(result.length === 1); - Search.remove(item.name); + expect(result).toHaveLength(1); + Search.remove(item.name); result = Search.query('test6'); - assert(result.length === 0); - }); + expect(result).toHaveLength(0); + }); }); diff --git a/test/unit/api/utils.spec.js b/test/unit/api/utils.spec.js index e049e0427..6e7ccf3fe 100644 --- a/test/unit/api/utils.spec.js +++ b/test/unit/api/utils.spec.js @@ -1,5 +1,4 @@ // @flow -import assert from 'assert'; import { generateGravatarUrl, GRAVATAR_DEFAULT } from '../../../src/utils/user'; import { spliceURL } from '../../../src/utils/string'; import Package from '../../../src/webui/components/Package/index'; @@ -255,14 +254,14 @@ describe('Utilities', () => { expect(function ( ) { // $FlowFixMe validateMetadata(''); - }).toThrow(assert.AssertionError); + }).toThrow(expect.hasAssertions()); }); test('should fails the assertions is name does not match', () => { expect(function ( ) { // $FlowFixMe validateMetadata({}, "no-name"); - }).toThrow(assert.AssertionError); + }).toThrow(expect.hasAssertions()); }); }); });