Skip to content

Convert test suite to use sinon assertions #972

Open
@kumar303

Description

@kumar303

Is this a feature request or a bug?

feature

What is the current behavior?

In the test suite we do things like this to check that stub objects are called correctly:

assert.ok(addonReload.called);
assert.equal(addonReload.firstCall.args[0].addonId,
  tempInstallResult.addon.id);

What is the expected or desired behavior?

It works but the failure messages could be better. Let's switch all of this code to sinon assertions instead.

The above test would be rewritten as:

sinon.assert.calledWith(
  addonReload, sinon.match({addonId: tempInstallResult.addon.id})
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions