Opened 2 years ago

Last modified 22 months ago

#6884 closed change

Migrate from nodeunit to mocha (in adblockpluschrome) — at Initial Version

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-3.4-for-Chrome-Opera-Firefox
Module: Platform Keywords:
Cc: tlucas, kzar, hfiguiere Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):



With #6717 we introduced nodeuntit in adblockpluschrome in order to wrap WebDriver to run the actual (qunit) tests from the command line and the CI. We decided to use nodeunit becasue this is historically what we use in adblockpluscore (we might want to migrate to Mocha there as well).

There are following issues with nodeunit:

  • nodeunitis deprecated and no longer maintained.
  • If a test failed, the process appears to be terminated before completing pending asynchronous tasks, which calls for obscure workarounds (if available) when dealing with resources that need to be cleaned up (e.g. browser processes managed through WebDriver).
  • There is no concept of shared resources, setUp and tearDown are always called for each test, making it difficult to share resources (that require cleanup) across tests.

The latter two make it in particular impossible to extend the test suite (e.g. by running against our test pages), without resulting into an inferior test architecture and slower performance.

What to change

Replace nodeunitwith the Mocha test framework in adblockpluchrome. While on it, leverage the before and after hooks (which wasn't possible before and will help to add more tests).

Change History (0)

Note: See TracTickets for help on using tickets.