Skip to content

Commit

Permalink
Remove ExecutionEnvironment dependency from DOMServerIntegrationTest
Browse files Browse the repository at this point in the history
It's not necessary since Stack.
  • Loading branch information
gaearon committed Nov 23, 2017
1 parent 10c981f commit d902803
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

'use strict';

let ExecutionEnvironment;
let PropTypes;
let React;
let ReactDOM;
Expand Down Expand Up @@ -73,9 +72,7 @@ async function expectErrors(fn, count) {
// returns a Promise that resolves when the render is complete.
function renderIntoDom(reactElement, domElement, forceHydrate, errorCount = 0) {
return expectErrors(async () => {
ExecutionEnvironment.canUseDOM = true;
await asyncReactDOMRender(reactElement, domElement, forceHydrate);
ExecutionEnvironment.canUseDOM = false;
return domElement.firstChild;
}, errorCount);
}
Expand Down Expand Up @@ -186,9 +183,7 @@ const clientRenderOnBadMarkup = async (element, errorCount = 0) => {

// Next we render the element into a clean DOM node client side.
const cleanDomElement = document.createElement('div');
ExecutionEnvironment.canUseDOM = true;
await asyncReactDOMRender(element, cleanDomElement, true);
ExecutionEnvironment.canUseDOM = false;
// This gives us the expected text content.
const cleanTextContent = cleanDomElement.textContent;

Expand Down Expand Up @@ -320,8 +315,6 @@ function resetModules() {
// First, reset the modules to load the client renderer.
jest.resetModuleRegistry();

// TODO: can we express this test with only public API?
ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
require('shared/ReactFeatureFlags').enableReactFragment = true;

PropTypes = require('prop-types');
Expand All @@ -340,8 +333,6 @@ function resetModules() {
describe('ReactDOMServerIntegration', () => {
beforeEach(() => {
resetModules();

ExecutionEnvironment.canUseDOM = false;
});

describe('basic rendering', function() {
Expand Down

0 comments on commit d902803

Please sign in to comment.