cli: split and bump eslint dependencies + fix issues
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
resolveCodeOwner,
|
||||
} from './CodeOwnersProcessor';
|
||||
|
||||
describe(CodeOwnersProcessor, () => {
|
||||
describe('CodeOwnersProcessor', () => {
|
||||
const mockUrl = ({ basePath = '' } = {}): string =>
|
||||
`https://github.com/spotify/backstage/blob/master/${basePath}catalog-info.yaml`;
|
||||
const mockLocation = ({
|
||||
@@ -79,7 +79,7 @@ describe(CodeOwnersProcessor, () => {
|
||||
return data;
|
||||
};
|
||||
|
||||
describe(buildUrl, () => {
|
||||
describe('buildUrl', () => {
|
||||
it.each([['azure.com'], ['dev.azure.com']])(
|
||||
'should throw not implemented error',
|
||||
source => {
|
||||
@@ -99,7 +99,7 @@ describe(CodeOwnersProcessor, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe(buildCodeOwnerUrl, () => {
|
||||
describe('buildCodeOwnerUrl', () => {
|
||||
it('should build a location spec to the codeowners', () => {
|
||||
expect(buildCodeOwnerUrl(mockUrl(), '/docs/CODEOWNERS')).toEqual(
|
||||
'https://github.com/spotify/backstage/blob/master/docs/CODEOWNERS',
|
||||
@@ -116,13 +116,13 @@ describe(CodeOwnersProcessor, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe(parseCodeOwners, () => {
|
||||
describe('parseCodeOwners', () => {
|
||||
it('should parse the codeowners file', () => {
|
||||
expect(parseCodeOwners(mockCodeOwnersText())).toEqual(mockCodeOwners());
|
||||
});
|
||||
});
|
||||
|
||||
describe(normalizeCodeOwner, () => {
|
||||
describe('normalizeCodeOwner', () => {
|
||||
it('should remove org from org/team format', () => {
|
||||
expect(normalizeCodeOwner('@acme/foo')).toBe('foo');
|
||||
});
|
||||
@@ -139,13 +139,13 @@ describe(CodeOwnersProcessor, () => {
|
||||
);
|
||||
});
|
||||
|
||||
describe(findPrimaryCodeOwner, () => {
|
||||
describe('findPrimaryCodeOwner', () => {
|
||||
it('should return the primary owner', () => {
|
||||
expect(findPrimaryCodeOwner(mockCodeOwners())).toBe('backstage-core');
|
||||
});
|
||||
});
|
||||
|
||||
describe(findRawCodeOwners, () => {
|
||||
describe('findRawCodeOwners', () => {
|
||||
it('should return found codeowner', async () => {
|
||||
const ownersText = mockCodeOwnersText();
|
||||
const read = jest
|
||||
@@ -184,7 +184,7 @@ describe(CodeOwnersProcessor, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe(resolveCodeOwner, () => {
|
||||
describe('resolveCodeOwner', () => {
|
||||
it('should return found codeowner', async () => {
|
||||
const read = jest
|
||||
.fn()
|
||||
@@ -207,7 +207,7 @@ describe(CodeOwnersProcessor, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe(CodeOwnersProcessor, () => {
|
||||
describe('CodeOwnersProcessor', () => {
|
||||
const setupTest = ({ kind = 'Component', spec = {} } = {}) => {
|
||||
const entity = { kind, spec };
|
||||
const read = jest
|
||||
|
||||
@@ -79,12 +79,14 @@ describe('<BarChart />', () => {
|
||||
it('Should display only 6 resources by default, sorted by cost', async () => {
|
||||
const rendered = await renderWithProps({} as BarChartProps);
|
||||
|
||||
MockResources.sort(resourceSort).forEach((resource, index) => {
|
||||
if (index < 6) {
|
||||
expect(rendered.getByText(resource.name!)).toBeInTheDocument();
|
||||
} else {
|
||||
expect(rendered.queryByText(resource.name!)).not.toBeInTheDocument();
|
||||
}
|
||||
const sorted = MockResources.sort(resourceSort);
|
||||
|
||||
expect(sorted.length).toBe(10);
|
||||
sorted.slice(0, 6).forEach(resource => {
|
||||
expect(rendered.getByText(resource.name!)).toBeInTheDocument();
|
||||
});
|
||||
sorted.slice(6).forEach(resource => {
|
||||
expect(rendered.queryByText(resource.name!)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -59,10 +59,9 @@ describe('<ProjectSelect />', () => {
|
||||
const button = getByRole(projectSelectContainer, 'button');
|
||||
UserEvent.click(button);
|
||||
await waitFor(() => rendered.getByTestId('option-all'));
|
||||
mockProjects.forEach(
|
||||
project =>
|
||||
project.id &&
|
||||
expect(rendered.getByText(project.id)).toBeInTheDocument(),
|
||||
|
||||
mockProjects.forEach(project =>
|
||||
expect(rendered.getByText(project.id)).toBeInTheDocument(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -163,7 +163,7 @@ describe('AuditView', () => {
|
||||
});
|
||||
|
||||
describe('when the request for the website by id is pending', () => {
|
||||
it('it shows the loading', async () => {
|
||||
it('shows the loading', async () => {
|
||||
mockFetch.mockImplementationOnce(() => new Promise(() => {}));
|
||||
const rendered = render(
|
||||
wrapInTestApp(
|
||||
@@ -177,7 +177,7 @@ describe('AuditView', () => {
|
||||
});
|
||||
|
||||
describe('when the request for the website by id fails', () => {
|
||||
it('it shows an error', async () => {
|
||||
it('shows an error', async () => {
|
||||
mockFetch.mockRejectOnce(new Error('failed to fetch'));
|
||||
const rendered = render(
|
||||
wrapInTestApp(
|
||||
|
||||
@@ -75,7 +75,7 @@ describe('useWebsiteForEntity', () => {
|
||||
(mockLighthouseApi.getWebsiteByUrl as jest.Mock).mockResolvedValue(website);
|
||||
});
|
||||
|
||||
it('returns the lighthouse information for the website url in annotations ', async () => {
|
||||
it('returns the lighthouse information for the website url in annotations', async () => {
|
||||
const { result, waitForNextUpdate } = subject();
|
||||
await waitForNextUpdate();
|
||||
expect(result.current?.value).toBe(website);
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ describe('RegisterComponentForm', () => {
|
||||
expect(screen.getByText('Submit').closest('button')).toBeDisabled();
|
||||
});
|
||||
|
||||
it('should enable a submit button when the target url is set ', async () => {
|
||||
it('should enable a submit button when the target url is set', async () => {
|
||||
render(<RegisterComponentForm onSubmit={jest.fn()} />);
|
||||
|
||||
await act(async () => {
|
||||
|
||||
Reference in New Issue
Block a user