agentsoz / ees-ui

Emeregency Evacuation Simulator (EES) - Web Client
3 stars 2 forks source link

Set up unit testing to run on Travis #2

Closed dhixsingh closed 5 years ago

dhixsingh commented 6 years ago

Look into vue component testing using test-utilts, mocha, chai.

ayoung012 commented 6 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

ayoung012 commented 6 years ago

@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

ayoung012 commented 6 years ago

https://github.com/mapbox/mapbox-gl-js/issues/5026 Mapbox mock lib usage with jest