Skip to content

Proposal for integration/unit testing #36

@geoffdutton

Description

@geoffdutton

@gorhill I'm not sure if this is something you're interested in, but here is my proposal for unit testing: https://github.com/geoffdutton/uBlock/tree/unit-tests-proposal
Here is the current diff: https://github.com/gorhill/uBlock/compare/master...geoffdutton:unit-tests-proposal?expand=1

I've written a few test cases, and would be happy to contribute more. I think it can help for two main reasons:

  1. Preventing regressions
  2. Refactoring code and trying performance improvements

Number 2 is especially nice, such as when parsing new filter syntaxes or running extreme scenarios.

I'd be happy to go into more detail on how to write tests, when to mock functions, how to mimic browser features, etc. I chose jest because it's fast, and you can mimic any browser like here.

Let me know if this is something you're interested in incorporating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionweighing in community's input on a specific topic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions