mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -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 Search from '../../../src/lib/search';
|
||||||
import Config from '../../../src/lib/config';
|
import Config from '../../../src/lib/config';
|
||||||
import Storage from '../../../src/lib/storage';
|
import Storage from '../../../src/lib/storage';
|
||||||
|
@ -45,7 +44,7 @@ describe('search', () => {
|
||||||
|
|
||||||
test('search query item', () => {
|
test('search query item', () => {
|
||||||
let result = Search.query('t');
|
let result = Search.query('t');
|
||||||
assert(result.length === 3);
|
expect(result).toHaveLength(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('search remove item', () => {
|
test('search remove item', () => {
|
||||||
|
@ -58,9 +57,9 @@ describe('search', () => {
|
||||||
};
|
};
|
||||||
Search.add(item);
|
Search.add(item);
|
||||||
let result = Search.query('test6');
|
let result = Search.query('test6');
|
||||||
assert(result.length === 1);
|
expect(result).toHaveLength(1);
|
||||||
Search.remove(item.name);
|
Search.remove(item.name);
|
||||||
result = Search.query('test6');
|
result = Search.query('test6');
|
||||||
assert(result.length === 0);
|
expect(result).toHaveLength(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// @flow
|
// @flow
|
||||||
import assert from 'assert';
|
|
||||||
import { generateGravatarUrl, GRAVATAR_DEFAULT } from '../../../src/utils/user';
|
import { generateGravatarUrl, GRAVATAR_DEFAULT } from '../../../src/utils/user';
|
||||||
import { spliceURL } from '../../../src/utils/string';
|
import { spliceURL } from '../../../src/utils/string';
|
||||||
import Package from '../../../src/webui/components/Package/index';
|
import Package from '../../../src/webui/components/Package/index';
|
||||||
|
@ -255,14 +254,14 @@ describe('Utilities', () => {
|
||||||
expect(function ( ) {
|
expect(function ( ) {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
validateMetadata('');
|
validateMetadata('');
|
||||||
}).toThrow(assert.AssertionError);
|
}).toThrow(expect.hasAssertions());
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should fails the assertions is name does not match', () => {
|
test('should fails the assertions is name does not match', () => {
|
||||||
expect(function ( ) {
|
expect(function ( ) {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
validateMetadata({}, "no-name");
|
validateMetadata({}, "no-name");
|
||||||
}).toThrow(assert.AssertionError);
|
}).toThrow(expect.hasAssertions());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue