Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
// Create store.
const config: HeadTagsPackage = clone(headTagsPackage());
// Mock wp-source state.
const {
state: { source }
} = clone(wpSource());
config.state.source = source;
config.state.source.api = "https://test.frontity.io/wp-json";
// Mock router state.
config.state.router = { link: "/" };
// Mock site url.
config.state.frontity = { url: "https://mars.frontity.org" };
// Initialize store.
store = createStore(config);
});
beforeEach(() => {
warn.mockClear();
// Create store.
const config: HeadTagsPackage = clone(headTagsPackage());
// Mock wp-source state.
config.state.source = clone(wpSource()).state.source;
config.state.source.api = "https://test.frontity.io/wp-json";
// Mock router state.
config.state.router = { link: "/" };
// Mock site url.
config.state.frontity = { url: "https://mars.frontity.org" };
// Initialize store.
store = createStore(config);
});