chore: update mocks, move configs to jest dir

This commit is contained in:
alxshelepenok
2019-05-09 00:11:44 +03:00
parent 42d6377fde
commit 32351b33c2
7 changed files with 45 additions and 15 deletions

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = 'file';

29
jest/__mocks__/gatsby.js Normal file
View File

@@ -0,0 +1,29 @@
'use strict';
const React = require('react');
const gatsby = jest.requireActual('gatsby');
module.exports = {
...gatsby,
graphql: jest.fn(),
Link: jest.fn().mockImplementation(
({
activeClassName,
activeStyle,
getProps,
innerRef,
ref,
replace,
to,
...rest
}) => (
React.createElement('a', {
...rest,
href: to,
})
)
),
StaticQuery: jest.fn(),
useStaticQuery: jest.fn(),
};