mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 09:11:57 +10:00
Set up Unit Testing environment with Gatsby, Jest and @testing-library/react; added some basic unit tests for Castform template
This commit is contained in:
15
__mocks__/gatsby.js
Normal file
15
__mocks__/gatsby.js
Normal file
@ -0,0 +1,15 @@
|
||||
const React = require(`react`);
|
||||
const gatsby = jest.requireActual(`gatsby`);
|
||||
|
||||
module.exports = {
|
||||
...gatsby,
|
||||
graphql: jest.fn(),
|
||||
Link: jest.fn().mockImplementation(({ to, ...rest }) =>
|
||||
React.createElement(`a`, {
|
||||
...rest,
|
||||
href: to,
|
||||
}),
|
||||
),
|
||||
StaticQuery: jest.fn(),
|
||||
useStaticQuery: jest.fn(),
|
||||
};
|
||||
Reference in New Issue
Block a user