Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuking global in node using [email protected] #13

Open
joeyfigaro opened this issue Mar 17, 2017 · 0 comments
Open

Nuking global in node using [email protected] #13

joeyfigaro opened this issue Mar 17, 2017 · 0 comments

Comments

@joeyfigaro
Copy link

joeyfigaro commented Mar 17, 2017

Referenced here - looks like setting this up for my tests clobbers the available global in node. console.log no longer works and the properties I've added to global (APP_CONFIG, etc.) don't exist.

test-setup.js

/*
	 eslint-disable
	import/no-unresolved,
	import/no-webpack-loader-syntax,
	no-return-assign,
	no-prototype-builtins
*/
const mockBrowser = require('mock-browser').mocks.MockBrowser;
const MockBrowser = new mockBrowser();

global.APP_CONFIG = require('!CONFIG').default;

global.__DEVELOPMENT__ = false;
global.__TESTING__ = true;
global.__PRODUCTION__ = false;
global.document = MockBrowser.createDocument();
global.window = MockBrowser.createWindow();
global.localStorage = MockBrowser.getLocalStorage();
@joeyfigaro joeyfigaro changed the title Nuking global in node using [email protected] Nuking global in node using [email protected] Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant