- Organisation: WorldBrain - Verifying the Internet with Science
- Proposal: Implementation of Continuous Integration Pipeline and a Testing Suite for WorldBrain
- Student: Shivang / @reficul31
- Mentors:
- Jonas / @sanjo
- Stefano / @obsidianart
- Dan / @danrl
- Raj / @raj-maurya
- Repositories:
- Status:
- Proposal - Proposal submitted to the organisation
- Blog - Contains the day to day account of the work done by @reficul31
- Project Issue - Contains the details of the issue
- First Evaluation Report - Report for the first evaluation
- Second Evaluation Report - Report for the secong evaluation
- Adding Jest Presets (Merged)
- Unit tests for Freeze Dry (Merged)
- Monkey Patch for insertAdjacentElement (Merged)
- Unit tests for Response to Data URL (Merged)
- Unit tests for When All Settled (Merged)
- Unit tests for Activity Logger (Open)
- Unit tests for Page Storage (Open)
- Unit tests for Page Analysis (Open)
- Unit tests for Util (Open)
- System Tests for Freeze Dry (Open)
- Documentation for Freeze Dry (Open)
Before the GSoC project the code of the webmemex-extension was untested and raw. This project has allowed to raise the code coverage of the tests from 0% to 69%. The statistics are given below.
Total Number of Tests Written:
Coverage of the Testing Suite:
- The Relative Path Problem
This error was related to how jest was unable to resolve some of the relative module paths. At first I made use of Babel Root Slash Import. But my mentor @sanjo suggested, I should resovle this error using the modulePath configuration in jest. - The PouchDB Node Adapter Problem
This error was related to how the PouchDB configuration was not able to ru with the Node the environment that the Jest test runner uses. Although we ended up switching the environment to browser in the consecutive weeks, we got around that error by adding an adapter(PouchDB Adapter Memory) to the PouchDB config and mocking all calls to the database. - The Import Styles Problem
This error was related to how the different components in the overview module of the webmemex extension make use of css-modulesify. But jest wasn't percieving this valid. The solution was to include the moduleMapper](https://www.npmjs.com/package/identity-obj-proxy) in jest. - Mocking Browser Calls
The webmemex extension makes use of many browser functions such asbrowser.history.search
. As the environment was node the browser object wasn't available to the test runner. The solution was simple; to mock all the calls to the browser object. - Monkey Patching insertAdjacentElement
The webmemex extension makes use of the functioniserAdjacentElement
to insert nodes into the document object model. This was a major problem for testing the component as the methodinsertAdjacentElement
wasn't implemented in the current version of jsdom. So the solution as suggested by @sanjo was to monkey patch an insertAdjacentElement method to the test runner. - PouchDB Node Buffer-Blob Problem
This error was related to how the storage in pouchdb takes place. Apparently the PouchDB Node version doesn't support Blob Object storage therefore the object had to be converted to Buffer before storage or another solution as suggested and implemented by @sanjo was to change the environment of the test runner from node to browser. This allowed us to use the already exisiting configuration of the PouchDB and also added support for Blob storage.