Last active
June 27, 2018 21:48
-
-
Save Shelob9/220cffabcbd567b7039259b6066d1e3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ "@wordpress/default" ] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jest": { | |
"collectCoverageFrom": [ | |
"clients/**/*.js" | |
], | |
"coverageThreshold": { | |
"global": { | |
"statements": 90, | |
"branches": 90, | |
"functions": 90, | |
"lines": 90 | |
} | |
}, | |
"automock": false, | |
"setupFiles": [ | |
"./clients/tests/setupJest.js" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global.wp = { | |
shortcode: { | |
}, | |
apiRequest: { | |
} | |
}; | |
Object.defineProperty( global.wp, 'element', { | |
get: () => require( 'React' ), | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define WordPress dependencies | |
const wpDependencies = [ 'components', 'element', 'blocks', 'utils', 'date' ]; | |
// Setup externals for all WordPress dependencies | |
wpDependencies.forEach( wpDependency => { | |
externals[ '@wordpress/' + wpDependency ] = { | |
this: [ 'wp', wpDependency ] | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
Object.defineProperty( global.wp, 'element', { | |
get: () => React | |
} ); | |
//The rest of the code... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment