Skip to content

Instantly share code, notes, and snippets.

@reficul31
Last active November 3, 2017 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reficul31/3cf54d8b40fc5e2e580500eab8409765 to your computer and use it in GitHub Desktop.
Save reficul31/3cf54d8b40fc5e2e580500eab8409765 to your computer and use it in GitHub Desktop.
GSoc 2017 Report

GSoC 2017 Project

Important Links

Pull Requests

Before GSoC

During GSoC

Work Done During the Project Timeline

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:
Test Stats
Coverage of the Testing Suite:
Coverage Report

Problems Encountered During the Program

  • 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 as browser.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 function iserAdjacentElement to insert nodes into the document object model. This was a major problem for testing the component as the method insertAdjacentElement 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment