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('