mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(tests): mock fetch for LabelValueInput tests
Gettings lots of nodejs warnings about unhandled fetch errors due to lack of mocks for suggestion fetch requests, add mocks to supress those
This commit is contained in:
@@ -14,6 +14,10 @@ import { LabelValueInput } from "./LabelValueInput";
|
||||
let silenceFormStore;
|
||||
let matcher;
|
||||
|
||||
beforeAll(() => {
|
||||
fetch.mockResponse(JSON.stringify([]));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
silenceFormStore = new SilenceFormStore();
|
||||
matcher = NewEmptyMatcher();
|
||||
@@ -28,6 +32,10 @@ beforeEach(() => {
|
||||
];
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
const ShallowLabelValueInput = isValid => {
|
||||
return shallow(
|
||||
<LabelValueInput
|
||||
|
||||
Reference in New Issue
Block a user