mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
refactor: remove all assert imports (#1049)
* refactor: remove assert imports * Update search.spec.js
This commit is contained in:
parent
919828fd32
commit
83289224cc
2 changed files with 7 additions and 9 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue