diff --git a/test/e2e/e2e.spec.js b/test/e2e/e2e.spec.js
index 85be58f82..bdab8877e 100644
--- a/test/e2e/e2e.spec.js
+++ b/test/e2e/e2e.spec.js
@@ -55,33 +55,33 @@ describe('/ (Verdaccio Page)', () => {
await page.close();
});
- it('should load without error', async () => {
+ test('should load without error', async () => {
const text = await page.evaluate(() => document.body.textContent);
// FIXME: perhaps it is not the best approach
expect(text).toContain('Powered by');
});
- it('should match title with no packages published', async () => {
+ test('should match title with no packages published', async () => {
const text = await page.evaluate(() => document.querySelector('#help-card__title').textContent);
expect(text).toMatch('No Package Published Yet');
});
- it('should match title with first step', async () => {
+ test('should match title with first step', async () => {
const text = await page.evaluate(() => document.querySelector('#help-card').textContent);
expect(text).toContain('$ npm adduser --registry http://0.0.0.0:55558');
});
- it('should match title with second step', async () => {
+ test('should match title with second step', async () => {
const text = await page.evaluate(() => document.querySelector('#help-card').textContent);
expect(text).toContain('$ npm publish --registry http://0.0.0.0:55558');
});
- it('should match button Login to sign in', async () => {
+ test('should match button Login to sign in', async () => {
await evaluateSignIn();
});
- it('should click on sign in button', async () => {
+ test('should click on sign in button', async () => {
const signInButton = await page.$('#header--button-login');
await signInButton.click();
await page.waitFor(1000);
@@ -90,7 +90,7 @@ describe('/ (Verdaccio Page)', () => {
expect(signInDialog).not.toBeNull();
});
- it('should log in an user', async () => {
+ test('should log in an user', async () => {
// we open the dialog
await logIn();
// check whether user is logged
@@ -98,7 +98,7 @@ describe('/ (Verdaccio Page)', () => {
expect(buttonLogout).toBeDefined();
});
- it('should logout an user', async () => {
+ test('should logout an user', async () => {
// we assume the user is logged already
await clickElement('#header--button-account', { clickCount: 1, delay: 500 });
await page.waitFor(1000);
@@ -107,7 +107,7 @@ describe('/ (Verdaccio Page)', () => {
await evaluateSignIn();
});
- it('should check registry info dialog', async () => {
+ test('should check registry info dialog', async () => {
const registryInfoButton = await page.$('#header--button-registryInfo');
registryInfoButton.click();
await page.waitFor(500);
@@ -119,7 +119,7 @@ describe('/ (Verdaccio Page)', () => {
closeButton.click();
});
- it('should publish a package', async () => {
+ test('should publish a package', async () => {
await global.__SERVER__.putPackage(scopedPackageMetadata.name, scopedPackageMetadata);
await page.waitFor(1000);
await page.reload();
@@ -129,7 +129,7 @@ describe('/ (Verdaccio Page)', () => {
expect(packagesList).toHaveLength(1);
});
- it('should navigate to the package detail', async () => {
+ test('should navigate to the package detail', async () => {
const packagesList = await getPackages();
const packageItem = packagesList[0];
await packageItem.focus();
@@ -139,12 +139,12 @@ describe('/ (Verdaccio Page)', () => {
expect(readmeText).toMatch('test');
});
- it('should contains last sync information', async () => {
+ test('should contains last sync information', async () => {
const versionList = await page.$$('.sidebar-info .last-sync-item');
expect(versionList).toHaveLength(3);
});
- it('should publish a protected package', async () => {
+ test('should publish a protected package', async () => {
await page.goto('http://0.0.0.0:55552');
await page.waitFor(500);
await global.__SERVER_PROTECTED__.putPackage(protectedPackageMetadata.name, protectedPackageMetadata);
diff --git a/test/unit/webui/app.spec.js b/test/unit/webui/app.spec.js
index 778bca95e..4a19582e8 100644
--- a/test/unit/webui/app.spec.js
+++ b/test/unit/webui/app.spec.js
@@ -37,7 +37,7 @@ describe('App', () => {
beforeEach(() => {
wrapper = mount();
});
- it('loadLogo: set logo url in state', async () => {
+ test('loadLogo: set logo url in state', async () => {
const { loadLogo } = wrapper.instance();
await loadLogo();
expect(wrapper.state().logoUrl).toEqual(
@@ -45,7 +45,7 @@ describe('App', () => {
);
});
- it('toggleLoginModal: should toggle the value in state', () => {
+ test('toggleLoginModal: should toggle the value in state', () => {
const { toggleLoginModal } = wrapper.instance();
expect(wrapper.state().showLoginModal).toBeFalsy();
toggleLoginModal();
@@ -53,7 +53,7 @@ describe('App', () => {
expect(wrapper.state('error')).toEqual({});
});
- it('isUserAlreadyLoggedIn: token already available in storage', async () => {
+ test('isUserAlreadyLoggedIn: token already available in storage', async () => {
storage.setItem('username', 'verdaccio');
storage.setItem('token', generateTokenWithTimeRange(24));
@@ -64,7 +64,7 @@ describe('App', () => {
expect(wrapper.state('user').username).toEqual('verdaccio');
});
- it('handleLogout - logouts the user and clear localstorage', async () => {
+ test('handleLogout - logouts the user and clear localstorage', async () => {
const { handleLogout } = wrapper.instance();
storage.setItem('username', 'verdaccio');
storage.setItem('token', 'xxxx.TOKEN.xxxx');
@@ -74,7 +74,7 @@ describe('App', () => {
expect(wrapper.state('isUserLoggedIn')).toBeFalsy();
});
- it('doLogin - login the user successfully', async () => {
+ test('doLogin - login the user successfully', async () => {
const { doLogin } = wrapper.instance();
await doLogin('sam', '1234');
const result = {
@@ -88,7 +88,7 @@ describe('App', () => {
expect(wrapper.state('user')).toEqual(result);
});
- it('doLogin - authentication failure', async () => {
+ test('doLogin - authentication failure', async () => {
const { doLogin } = wrapper.instance();
await doLogin('sam', '12345');
console.log(API_ERROR.BAD_USERNAME_PASSWORD);
diff --git a/test/unit/webui/components/PackageSidebar/infos.spec.js b/test/unit/webui/components/PackageSidebar/infos.spec.js
index 88d42f66e..92efe6e16 100644
--- a/test/unit/webui/components/PackageSidebar/infos.spec.js
+++ b/test/unit/webui/components/PackageSidebar/infos.spec.js
@@ -7,12 +7,12 @@ import { shallow } from 'enzyme';
import Infos from '../../../../../src/webui/components/PackageSidebar/modules/Infos/index';
describe(' : ', () => {
- it('should load the component without props', () => {
+ test('should load the component without props', () => {
const wrapper = shallow();
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the Info component with props', () => {
+ test('should load the Info component with props', () => {
const props = {
homepage: 'https://www.verdaccio.org',
license: 'MIT',
@@ -22,7 +22,7 @@ describe(' : ', () => {
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the Info component with homepage only', () => {
+ test('should load the Info component with homepage only', () => {
const props = {
homepage: 'https://www.verdaccio.org'
}
@@ -30,7 +30,7 @@ describe(' : ', () => {
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the Info component with license only', () => {
+ test('should load the Info component with license only', () => {
const props = {
license: 'MIT',
}
@@ -38,7 +38,7 @@ describe(' : ', () => {
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the Info component with repository only', () => {
+ test('should load the Info component with repository only', () => {
const props = { repository: 'https://github.com/verdaccio/verdaccio' };
const wrapper = shallow();
expect(wrapper.html()).toMatchSnapshot();
diff --git a/test/unit/webui/components/PackageSidebar/lastsync.spec.js b/test/unit/webui/components/PackageSidebar/lastsync.spec.js
index 1ed870770..7ab5b7f37 100644
--- a/test/unit/webui/components/PackageSidebar/lastsync.spec.js
+++ b/test/unit/webui/components/PackageSidebar/lastsync.spec.js
@@ -7,12 +7,12 @@ import { shallow } from 'enzyme';
import LastSync from '../../../../../src/webui/components/PackageSidebar/modules/LastSync/index';
describe(' : ', () => {
- it('should check the default props condition', () => {
+ test('should check the default props condition', () => {
const wrapper = shallow();
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the LastSync component and match snapshot', () => {
+ test('should load the LastSync component and match snapshot', () => {
const props = {
lastUpdated: '2017/12/14, 15:43:52',
recentReleases: [
diff --git a/test/unit/webui/components/PackageSidebar/maintainerInfo.spec.js b/test/unit/webui/components/PackageSidebar/maintainerInfo.spec.js
index 95a4caed8..b31a946bd 100644
--- a/test/unit/webui/components/PackageSidebar/maintainerInfo.spec.js
+++ b/test/unit/webui/components/PackageSidebar/maintainerInfo.spec.js
@@ -9,12 +9,12 @@ import MaintainerInfo from '../../../../../src/webui/components/PackageSidebar/m
console.error = jest.fn();
describe(' : ', () => {
- it('should throw error for required props', () => {
+ test('should throw error for required props', () => {
shallow();
expect(console.error).toBeCalled();
});
- it('should load the component and match with snapshot', () => {
+ test('should load the component and match with snapshot', () => {
const props = {
title: 'test-title',
name: 'test',
diff --git a/test/unit/webui/components/PackageSidebar/maintainers.spec.js b/test/unit/webui/components/PackageSidebar/maintainers.spec.js
index b992ae843..f6f69f93a 100644
--- a/test/unit/webui/components/PackageSidebar/maintainers.spec.js
+++ b/test/unit/webui/components/PackageSidebar/maintainers.spec.js
@@ -16,12 +16,12 @@ describe(' : ', () => {
instance = wrapper.instance();
});
- it('should match with the props', () => {
+ test('should match with the props', () => {
expect(wrapper.props().packageMeta).toEqual(packageMeta);
expect(wrapper.html()).toMatchSnapshot();
});
- it('author shoule be equal to User NPM', () => {
+ test('author shoule be equal to User NPM', () => {
expect(instance.author).toEqual({
avatar:
'https://www.gravatar.com/avatar/a5a236ba477ee98908600c40cda74f4a',
@@ -30,11 +30,11 @@ describe(' : ', () => {
});
});
- it('should get all the contributors with false for showAllContributors', () => {
+ test('should get all the contributors with false for showAllContributors', () => {
expect(instance.showAllContributors).toBeFalsy();
});
- it('should get unique contributors', () => {
+ test('should get unique contributors', () => {
const result = [
{
avatar:
@@ -70,7 +70,7 @@ describe(' : ', () => {
expect(instance.uniqueContributors).toEqual(result);
});
- it('should click on handleShowAllContributors', () => {
+ test('should click on handleShowAllContributors', () => {
wrapper.find('button').simulate('click');
expect(wrapper.state('showAllContributors')).toBeTruthy();
});
diff --git a/test/unit/webui/components/PackageSidebar/module.spec.js b/test/unit/webui/components/PackageSidebar/module.spec.js
index e30530ba0..a8705bd94 100644
--- a/test/unit/webui/components/PackageSidebar/module.spec.js
+++ b/test/unit/webui/components/PackageSidebar/module.spec.js
@@ -9,11 +9,11 @@ import Module from '../../../../../src/webui/components/PackageSidebar/Module/in
console.error = jest.fn();
describe(' : ', () => {
- it('should error for required props', () => {
+ test('should error for required props', () => {
shallow();
expect(console.error).toBeCalled();
});
- it('should load module component', () => {
+ test('should load module component', () => {
const props = {
title: 'Test title',
description: 'Test description',
diff --git a/test/unit/webui/components/PackageSidebar/moduleContentPlaceholder.spec.js b/test/unit/webui/components/PackageSidebar/moduleContentPlaceholder.spec.js
index 65cb7935b..d52087f09 100644
--- a/test/unit/webui/components/PackageSidebar/moduleContentPlaceholder.spec.js
+++ b/test/unit/webui/components/PackageSidebar/moduleContentPlaceholder.spec.js
@@ -9,11 +9,11 @@ import ModuleContentPlaceholder from '../../../../../src/webui/components/Packag
console.error = jest.fn();
describe(' : ', () => {
- it('should error for required props', () => {
+ test('should error for required props', () => {
shallow();
expect(console.error).toBeCalled();
});
- it('should load module component', () => {
+ test('should load module component', () => {
const props = {
text: 'Test text'
};
diff --git a/test/unit/webui/components/PackageSidebar/packageSidebar.spec.js b/test/unit/webui/components/PackageSidebar/packageSidebar.spec.js
index 1526103b5..5bf106f39 100644
--- a/test/unit/webui/components/PackageSidebar/packageSidebar.spec.js
+++ b/test/unit/webui/components/PackageSidebar/packageSidebar.spec.js
@@ -14,7 +14,7 @@ jest.mock('../../../../../src/webui/utils/api', () => ({
console.error = jest.fn();
describe(' component', () => {
- it('should throw error for the required props', () => {
+ test('should throw error for the required props', () => {
const wrapper = mount();
const { loadPackageData } = wrapper.instance();
expect(console.error).toBeCalled();
@@ -24,7 +24,7 @@ describe(' component', () => {
});
});
- it('should load the packageMeta', () => {
+ test('should load the packageMeta', () => {
const wrapper = mount();
const { loadPackageData } = wrapper.instance();
loadPackageData('verdaccio').then(response => {
diff --git a/test/unit/webui/components/footer.spec.js b/test/unit/webui/components/footer.spec.js
index af56a845e..dd825133b 100644
--- a/test/unit/webui/components/footer.spec.js
+++ b/test/unit/webui/components/footer.spec.js
@@ -14,7 +14,7 @@ describe(' component', () => {
wrapper = mount();
});
- it('should load the initial state of Footer component', () => {
+ test('should load the initial state of Footer component', () => {
expect(wrapper.html()).toMatchSnapshot();
});
});
diff --git a/test/unit/webui/components/help.spec.js b/test/unit/webui/components/help.spec.js
index c7851ca6f..af66b0221 100644
--- a/test/unit/webui/components/help.spec.js
+++ b/test/unit/webui/components/help.spec.js
@@ -7,7 +7,7 @@ import Help from '../../../../src/webui/components/Help/index';
describe(' component', () => {
- it('should render the component in default state', () => {
+ test('should render the component in default state', () => {
const wrapper = shallow();
expect(wrapper.html()).toMatchSnapshot();
});
diff --git a/test/unit/webui/components/login.spec.js b/test/unit/webui/components/login.spec.js
index ed31e5837..2d9becedf 100644
--- a/test/unit/webui/components/login.spec.js
+++ b/test/unit/webui/components/login.spec.js
@@ -25,12 +25,12 @@ const event = {
};
describe('', () => {
- it('should load the component in default state', () => {
+ test('should load the component in default state', () => {
const wrapper = mount();
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the component with props', () => {
+ test('should load the component with props', () => {
const props = {
visibility: true,
error: {
@@ -45,7 +45,7 @@ describe('', () => {
expect(wrapper.html()).toMatchSnapshot();
});
- it('onCancel: should close the login modal', () => {
+ test('onCancel: should close the login modal', () => {
const props = {
visibility: true,
error: {
@@ -61,7 +61,7 @@ describe('', () => {
expect(props.onCancel).toHaveBeenCalled();
});
- it('setCredentials - should set username and password in state', () => {
+ test('setCredentials - should set username and password in state', () => {
const props = {
visibility: true,
error: {},
@@ -78,7 +78,7 @@ describe('', () => {
expect(wrapper.state('form').password.value).toEqual('1234');
});
- it('validateCredentials: should validate credentials', async () => {
+ test('validateCredentials: should validate credentials', async () => {
const props = {
visibility: true,
error: {},
@@ -106,7 +106,7 @@ describe('', () => {
expect(submitCredentials).toHaveBeenCalledTimes(1);
});
- it('submitCredentials: should submit credentials', async () => {
+ test('submitCredentials: should submit credentials', async () => {
const props = {
onSubmit: jest.fn(),
};
diff --git a/test/unit/webui/components/noitems.spec.js b/test/unit/webui/components/noitems.spec.js
index b3c964bae..1f8b8f829 100644
--- a/test/unit/webui/components/noitems.spec.js
+++ b/test/unit/webui/components/noitems.spec.js
@@ -9,12 +9,12 @@ import NoItems from '../../../../src/webui/components/NoItems/index';
console.error = jest.fn();
describe(' component', () => {
- it('should load the component in default state', () => {
+ test('should load the component in default state', () => {
const wrapper = mount();
expect(wrapper.html()).toMatchSnapshot();
});
- it('should set html from props', () => {
+ test('should set html from props', () => {
const props = {
text: 'This is a test string'
};
diff --git a/test/unit/webui/components/notfound.spec.js b/test/unit/webui/components/notfound.spec.js
index 723218226..570651912 100644
--- a/test/unit/webui/components/notfound.spec.js
+++ b/test/unit/webui/components/notfound.spec.js
@@ -9,12 +9,12 @@ import NotFound from '../../../../src/webui/components/NotFound/index';
console.error = jest.fn();
describe(' component', () => {
- it('should load the component in default state', () => {
+ test('should load the component in default state', () => {
const wrapper = mount();
expect(wrapper.html()).toMatchSnapshot();
});
- it('should set html from props', () => {
+ test('should set html from props', () => {
const props = {
pkg: 'verdaccio'
};
diff --git a/test/unit/webui/components/package.spec.js b/test/unit/webui/components/package.spec.js
index 73d0f80a0..346f9c18c 100644
--- a/test/unit/webui/components/package.spec.js
+++ b/test/unit/webui/components/package.spec.js
@@ -19,7 +19,7 @@ const dateOneMonthAgo = () => {
}
describe(' component', () => {
- it('should load the component', () => {
+ test('should load the component', () => {
const props = {
name: 'verdaccio',
version: '1.0.0',
@@ -50,7 +50,7 @@ describe(' component', () => {
expect(wrapper.html()).toMatchSnapshot();
});
- it('should load the component without author', () => {
+ test('should load the component without author', () => {
const props = {
name: 'verdaccio',
version: '1.0.0',
diff --git a/test/unit/webui/components/packagedetail.spec.js b/test/unit/webui/components/packagedetail.spec.js
index b18be9d5f..4afd3f8c4 100644
--- a/test/unit/webui/components/packagedetail.spec.js
+++ b/test/unit/webui/components/packagedetail.spec.js
@@ -10,12 +10,12 @@ import {WEB_TITLE} from '../../../../src/lib/constants';
console.error = jest.fn();
describe(' component', () => {
- it('should give error for required props', () => {
+ test('should give error for required props', () => {
shallow();
expect(console.error).toBeCalled();
});
- it('should load the component', () => {
+ test('should load the component', () => {
const props = {
readMe: 'Test readme',
packageName: WEB_TITLE
diff --git a/test/unit/webui/components/packagelist.spec.js b/test/unit/webui/components/packagelist.spec.js
index 8cb825796..e73133200 100644
--- a/test/unit/webui/components/packagelist.spec.js
+++ b/test/unit/webui/components/packagelist.spec.js
@@ -9,7 +9,7 @@ import Help from '../../../../src/webui/components/Help/index';
import { BrowserRouter } from 'react-router-dom';
describe(' component', () => {
- it('should load the component with no packages', () => {
+ test('should load the component with no packages', () => {
const props = {
packages: [],
help: true
@@ -21,7 +21,7 @@ describe(' component', () => {
});
- it('should load the component with packages', () => {
+ test('should load the component with packages', () => {
const props = {
packages: [
{
diff --git a/test/unit/webui/components/readme.spec.js b/test/unit/webui/components/readme.spec.js
index 68e85c725..4b95db052 100644
--- a/test/unit/webui/components/readme.spec.js
+++ b/test/unit/webui/components/readme.spec.js
@@ -7,12 +7,12 @@ import { shallow, mount } from 'enzyme';
import Readme from '../../../../src/webui/components/Readme/index';
describe(' component', () => {
- it('should load the component in default state', () => {
+ test('should load the component in default state', () => {
const wrapper = mount();
expect(wrapper.html()).toMatchSnapshot();
});
- it('should dangerously set html', () => {
+ test('should dangerously set html', () => {
const wrapper = shallow();
expect(wrapper.html()).toEqual(
'
This is a test string
'
diff --git a/test/unit/webui/utils/login.spec.js b/test/unit/webui/utils/login.spec.js
index c3ee2f6b6..2c38e9611 100644
--- a/test/unit/webui/utils/login.spec.js
+++ b/test/unit/webui/utils/login.spec.js
@@ -13,30 +13,30 @@ jest.mock('.../../../../src/webui/utils/api', () => ({
}));
describe('isTokenExpire', () => {
- it('isTokenExpire - token is not present', () => {
+ test('isTokenExpire - token is not present', () => {
expect(isTokenExpire()).toBeTruthy();
});
- it('isTokenExpire - token is not a valid payload', () => {
+ test('isTokenExpire - token is not a valid payload', () => {
expect(isTokenExpire('not_a_valid_token')).toBeTruthy();
});
- it('isTokenExpire - token should not expire in 24 hrs range', () => {
+ test('isTokenExpire - token should not expire in 24 hrs range', () => {
const token = generateTokenWithTimeRange(24);
expect(isTokenExpire(token)).toBeFalsy();
});
- it('isTokenExpire - token should expire for current time', () => {
+ test('isTokenExpire - token should expire for current time', () => {
const token = generateTokenWithTimeRange();
expect(isTokenExpire(token)).toBeTruthy();
});
- it('isTokenExpire - token expiration is not available', () => {
+ test('isTokenExpire - token expiration is not available', () => {
const token = generateTokenWithOutExpiration();
expect(isTokenExpire(token)).toBeTruthy();
});
- it('isTokenExpire - token is not a valid json token', () => {
+ test('isTokenExpire - token is not a valid json token', () => {
const token = generateTokenWithExpirationAsString();
const result = [
'Invalid token:',
@@ -49,7 +49,7 @@ describe('isTokenExpire', () => {
});
describe('makeLogin', () => {
- it('makeLogin - should give error for blank username and password', async () => {
+ test('makeLogin - should give error for blank username and password', async () => {
const result = {
error: {
description: "Username or password can't be empty!",
@@ -61,14 +61,14 @@ describe('makeLogin', () => {
expect(login).toEqual(result);
});
- it('makeLogin - should login successfully', async () => {
+ test('makeLogin - should login successfully', async () => {
const { username, password } = { username: 'sam', password: '1234' };
const result = { token: 'TEST_TOKEN', username: 'sam' };
const login = await makeLogin(username, password);
expect(login).toEqual(result);
});
- it('makeLogin - login should failed with 401', async () => {
+ test('makeLogin - login should failed with 401', async () => {
const result = {
error: {
description: 'bad username/password, access denied',
@@ -82,7 +82,7 @@ describe('makeLogin', () => {
expect(login).toEqual(result);
});
- it('makeLogin - login should failed with when no data is sent', async () => {
+ test('makeLogin - login should failed with when no data is sent', async () => {
const result = {
error: {
title: 'Unable to login',
diff --git a/test/unit/webui/utils/logo.spec.js b/test/unit/webui/utils/logo.spec.js
index 7ddce77af..92e2abc9e 100644
--- a/test/unit/webui/utils/logo.spec.js
+++ b/test/unit/webui/utils/logo.spec.js
@@ -5,7 +5,7 @@ jest.mock('../../../../src/webui/utils/api', () => ({
}));
describe('logo', () => {
- it('loadLogo - should load verdaccio logo', async () => {
+ test('loadLogo - should load verdaccio logo', async () => {
const url = await logo();
expect(url).toEqual('http://localhost/-/static/logo.png');
});
diff --git a/test/unit/webui/utils/package.spec.js b/test/unit/webui/utils/package.spec.js
index f76113c43..45e434a6d 100644
--- a/test/unit/webui/utils/package.spec.js
+++ b/test/unit/webui/utils/package.spec.js
@@ -11,14 +11,14 @@ import {
import { packageMeta } from '../components/store/packageMeta';
describe('formatLicense', () => {
- it('should check license field different values', () => {
+ test('should check license field different values', () => {
expect(formatLicense('MIT')).toEqual('MIT');
});
- it('should check license field for object value', () => {
+ test('should check license field for object value', () => {
const license = { type: 'ISC', url: 'https://opensource.org/licenses/ISC' };
expect(formatLicense(license)).toEqual('ISC');
});
- it('should check license field for other value', () => {
+ test('should check license field for other value', () => {
expect(formatLicense(null)).toBeNull();
expect(formatLicense({})).toBeNull();
expect(formatLicense([])).toBeNull();
@@ -26,18 +26,18 @@ describe('formatLicense', () => {
});
describe('formatRepository', () => {
- it('should check repository field different values', () => {
+ test('should check repository field different values', () => {
const repository = 'https://github.com/verdaccio/verdaccio';
expect(formatRepository(repository)).toEqual(repository);
});
- it('should check repository field for object value', () => {
+ test('should check repository field for object value', () => {
const license = {
type: 'git',
url: 'https://github.com/verdaccio/verdaccio'
};
expect(formatRepository(license)).toEqual(license.url);
});
- it('should check repository field for other value', () => {
+ test('should check repository field for other value', () => {
expect(formatRepository(null)).toBeNull();
expect(formatRepository({})).toBeNull();
expect(formatRepository([])).toBeNull();
@@ -45,11 +45,11 @@ describe('formatRepository', () => {
});
describe('formatAuthor', () => {
- it('should check author field different values', () => {
+ test('should check author field different values', () => {
const author = 'verdaccioNpm';
expect(formatAuthor(author)).toEqual(author);
});
- it('should check author field for object value', () => {
+ test('should check author field for object value', () => {
const license = {
name: 'Verdaccion NPM',
email: 'verdaccio@verdaccio.org',
@@ -57,7 +57,7 @@ describe('formatAuthor', () => {
};
expect(formatAuthor(license)).toEqual('Verdaccion NPM');
});
- it('should check author field for other value', () => {
+ test('should check author field for other value', () => {
expect(formatAuthor(null)).toBeNull();
expect(formatAuthor({})).toBeNull();
expect(formatAuthor([])).toBeNull();
@@ -65,14 +65,14 @@ describe('formatAuthor', () => {
});
describe('formatDate', () => {
- it('should format the date', () => {
+ test('should format the date', () => {
const date = 1532211072138;
expect(formatDate(date)).toEqual('2018/07/21, 22:11:12');
});
});
describe('formatDateDistance', () => {
- it('should calculate the distance', () => {
+ test('should calculate the distance', () => {
const dateOneMonthAgo = () => {
const date = new Date();
date.setMonth(date.getMonth() - 1);
@@ -84,20 +84,20 @@ describe('formatDateDistance', () => {
});
describe('getLastUpdatedPackageTime', () => {
- it('should get the last update time', () => {
+ test('should get the last update time', () => {
const lastUpdated = packageMeta._uplinks;
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual(
'2018/07/22, 22:11:12'
);
});
- it('should get the last update time for blank uplink', () => {
+ test('should get the last update time for blank uplink', () => {
const lastUpdated = {};
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('');
});
});
describe('getRecentReleases', () => {
- it('should get the recent releases', () => {
+ test('should get the recent releases', () => {
const { time } = packageMeta;
const result = [
{ time: '2017/12/14, 15:43:27', version: '2.7.1' },