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

running tests with react-mapbox-gl installed #116

Closed
calocan opened this issue Feb 7, 2017 · 1 comment
Closed

running tests with react-mapbox-gl installed #116

calocan opened this issue Feb 7, 2017 · 1 comment

Comments

@calocan
Copy link

calocan commented Feb 7, 2017

I'm probably doing something obviously wrong here, but whenever react-mapbox-gl is installed I can't run any tests with babel-node. If my test command is:

cross-env $NODE_DEBUG_OPTION NODE_PATH='source' babel-node source/test/index.js

I get the following error when browserify tries to parse the dist. Is there a way to prevent this error or at least have babel-node ignore the module?

/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/mapbox-gl.js:225
"use strict";module.exports=self;
                            ^

ReferenceError: self is not defined
    at Object.112 (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/js/util/browser/window.js:4:18)
    at s (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1)
    at /Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1
    at Object.110../window (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/js/util/browser.js:8:16)
    at s (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1)
    at /Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1
    at Object.24.../package.json (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/js/mapbox-gl.js:3:17)
    at s (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1)
    at e (/Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1)
    at /Users/andy/code/rescape_ramble/node_modules/mapbox-gl/dist/node_modules/browser-pack/_prelude.js:1:1

@alex3165
Copy link
Owner

alex3165 commented Feb 7, 2017

Once #114 will be merged it should be different, can you try to run the test on this branch ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants