Skip to content

Commit

Permalink
Setup jQuery for jest #2818
Browse files Browse the repository at this point in the history
  • Loading branch information
New0 committed Jan 7, 2019
1 parent f3bf87b commit 8f5569f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clients/tests/setupJest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import jquery from 'jquery';

global.wp = {
shortcode: {
Expand All @@ -18,3 +19,8 @@ Object.defineProperty( global.wp, 'element', {
* @link https://www.npmjs.com/package/jest-fetch-mock#usage
*/
global.fetch = require('jest-fetch-mock');

/**
* Setup jQuery
*/
global.$ = global.jQuery = jquery;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"dangerously-set-inner-html": "^2.0.1",
"exports-loader": "^0.7.0",
"inputmask": "^3.3.11",
"jquery": "^3.3.1",
"lodash.remove": "^4.7.0",
"md5-file": "^4.0.0",
"react-dropzone": "^6.2.4",
Expand Down

0 comments on commit 8f5569f

Please sign in to comment.