Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions web/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:9003',
setupNodeEvents(on, config) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('@cypress/code-coverage/task')(on, config);
return config;
},
},
video: false,
viewportWidth: 1400,
Expand Down
26 changes: 26 additions & 0 deletions web/mockModules/dummy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,29 @@ export { WSFactory } from '@openshift-console/dynamic-plugin-sdk/lib/utils/k8s/w
export const useK8sWatchResource = () => [null, true, ''];
export const useActivePerspective = () => ['admin'];
export const useAccessReview = () => [true, false];

class FetchError extends Error {
status: number;
name: string;

constructor(message: string, status: number) {
super(message);
this.name = 'Fetch Error';
this.status = status;
}
}

export const consoleFetchJSON = async (
url: string,
_method: string,
init?: RequestInit,
_timeout?: number,
) => {
const response = await fetch(url, init);

if (!response.ok) {
const text = await response.text();
throw new FetchError(text, response.status);
}
return response.json();
};
Loading