Closed dhixsingh closed 5 years ago
Unit testing skeleton setup, looks difficult to test actual Mapbox-gl functionality without a browser.
See https://github.com/mapbox/mapbox-gl-js/issues/4199 https://github.com/mapbox/mapbox-gl-js-mock
@dhixsingh I was unable to get mapbox-gl-js-mock functioning in a unit test environment. I have switched to the jest testing framework as it seems to have better support for mocking libs: https://stackoverflow.com/questions/48866088/testing-a-react-mapbox-gl-with-jsodom-and-jest https://www.npmjs.com/package/@vue/cli-plugin-unit-jest
I have also implemented a first end-to-end nightwatch & selenium test (opens in a browser and runs clicks on the DOM, probably wont work in travis). Basic checking for DOM visibility and existence. Will need to experiment further to observe changes within Mapbox.
Check it out by running:
npm run test:e2e
https://github.com/mapbox/mapbox-gl-js/issues/5026 Mapbox mock lib usage with jest
Look into vue component testing using test-utilts, mocha, chai.