-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
'global is not defined' error when 'uglify-js' required into test suite #1719
Comments
Are you running on Node.js? If so, |
I'm running jest from npm scripts, node version 7.7.4 |
@alexlamsl Can you revert this recent change in -if (typeof DEBUG !== "undefined" && DEBUG) {
+if (global.UGLIFY_DEBUG) {
|
If you are running @kzc we don't use |
Trust me on this. There was another bug related to this same line. |
I thought the whole point of Either case, this particular flag should probably go altogether. There is no reason to export this over just one mocha test. |
Some do. After running the result of There's also a pending PR to get |
|
Oh I see - they don't use I'll spin up a PR to get rid of UGLIFY_DEBUG in a moment. |
That's your call. Here's the issue in question: #1148
$ git diff aa82027a1721ee7233e92ab1b9f9ced43a8f17cf^!
diff --git a/tools/exports.js b/tools/exports.js
index a481143..54aa23e 100644
--- a/tools/exports.js
+++ b/tools/exports.js
@@ -18,6 +18,6 @@ exports["tokenizer"] = tokenizer;
exports["is_identifier"] = is_identifier;
exports["SymbolDef"] = SymbolDef;
-if (DEBUG) {
+if (typeof DEBUG !== "undefined" && DEBUG) {
exports["EXPECT_DIRECTIVE"] = EXPECT_DIRECTIVE;
} |
@alexlamsl You could just export this unconditionally in
I don't know what the intention of this was:
|
Or just (edited) |
No worries, I have a workaround that removes the debug flag whilst still exercise the RegExp in question. |
Packages:
uglify-js@2.8.16
jest@19.0.2
__tests__/test.js
:build-static.js
:and when i run tests got this error
The text was updated successfully, but these errors were encountered: