diff --git a/App.test.js b/App.test.js index 05730ee91f..1e0b29528a 100644 --- a/App.test.js +++ b/App.test.js @@ -1,5 +1,7 @@ /** @format */ +import './globals'; + import React from 'react'; import renderer from 'react-test-renderer'; diff --git a/globals.js b/globals.js new file mode 100644 index 0000000000..bd85daff96 --- /dev/null +++ b/globals.js @@ -0,0 +1,7 @@ +/** @format */ + +import * as element from '@gutenberg/element'; + +global.wp = { + element, // load the element creation function, needed by Gutenberg-web +}; diff --git a/gutenberg b/gutenberg index 8ee1a4e237..a3d5ab4af3 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 8ee1a4e2370e5a0b734b68615b0b7d54fc5f6a99 +Subproject commit a3d5ab4af34941e5afb12eba3b620dce565a78e6 diff --git a/jest.config.js b/jest.config.js index aa357af36e..0d0a8b9570 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,6 +11,7 @@ if ( process.env.TEST_RN_PLATFORM ) { module.exports = { preset: 'jest-react-native', testEnvironment: 'jsdom', + testPathIgnorePatterns: [ '/node_modules/', '/gutenberg/' ], moduleNameMapper: { '@wordpress/hooks': '/wordpress/hooks', '@wordpress/i18n': '/gutenberg/i18n', diff --git a/package.json b/package.json index 7e78704241..b6367b925a 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,14 @@ "private": true, "devDependencies": { "@wordpress/babel-preset-default": "^1.1.2", + "babel-plugin-transform-async-generator-functions": "^6.24.1", "babel-preset-react-native-stage-0": "^1.0.1", "cross-env": "^5.1.4", "flow-bin": "0.56.0", "jest": "^22.4.3", "jest-react-native": "^18.0.0", "prettier": "git+https://github.com/Automattic/calypso-prettier.git#calypso-1.9", + "react-dom": "^16.2.0", "react-test-renderer": "16.2.0", "remote-redux-devtools": "^0.5.12" }, @@ -18,6 +20,7 @@ "android": "react-native run-android", "ios": "react-native run-ios", "test": "cross-env NODE_ENV=test node node_modules/jest/bin/jest.js --verbose --config jest.config.js", + "test-debug": "cross-env NODE_ENV=test node --inspect-brk node_modules/jest/bin/jest.js --runInBand --verbose --config jest.config.js", "flow": "flow", "prettier": "prettier --write *.js *block-management/*.js", "prettier-check": "prettier -l *.js *block-management/*.js" @@ -26,6 +29,7 @@ "babel-plugin-module-resolver": "^3.1.0", "classnames": "^2.2.5", "jed": "^1.1.1", + "memize": "^1.0.5", "react": "16.2.0", "react-native": "0.52.0", "react-redux": "^5.0.7", diff --git a/yarn.lock b/yarn.lock index bbab38448d..d2ad7407c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -533,6 +533,10 @@ babel-plugin-syntax-async-functions@^6.5.0, babel-plugin-syntax-async-functions@ version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + babel-plugin-syntax-class-constructor-call@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416" @@ -581,6 +585,14 @@ babel-plugin-syntax-trailing-function-commas@^6.20.0, babel-plugin-syntax-traili version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + babel-plugin-transform-async-to-generator@6.16.0: version "6.16.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999" @@ -3774,6 +3786,10 @@ mem@1.1.0, mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +memize@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/memize/-/memize-1.0.5.tgz#51d89e8407643dbc8cab98c6d56b889f9a3954e3" + merge-stream@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" @@ -4658,6 +4674,15 @@ react-devtools-core@3.0.0: shell-quote "^1.6.1" ws "^2.0.3" +react-dom@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + react-native@0.52.0: version "0.52.0" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.52.0.tgz#9784663a2aa40b30c87d4c9c06ef26cf8d419d91"