Adding Jest for testing

This commit is contained in:
Jeff Avallone
2019-01-04 18:38:49 -05:00
parent 6cff032efb
commit 8a3471b916
28 changed files with 5523 additions and 54 deletions
+14
View File
@@ -0,0 +1,14 @@
const React = require('react');
const gatsby = jest.requireActual('gatsby');
module.exports = {
...gatsby,
graphql: jest.fn().mockImplementation(([query]) => query),
Link: jest.fn().mockImplementation(({ to, ...rest }) =>
React.createElement('a', {
...rest,
href: to
})
),
StaticQuery: jest.fn()
};