Closed Bug 1259617 Opened 8 years ago Closed 8 years ago

Most assertEq() calls in webRequest tests have wrong arguments order

Categories

(WebExtensions :: General, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1314492

People

(Reporter: ma1, Assigned: ma1)

References

Details

(Whiteboard: [test] triaged)

While testing my additions and changes to the webRequest API I've been quite frustrated initially, before realizing that "got" and "expected" were often inverted in assertEq() tests. Gonna fix all them in this bug.
Whiteboard: [test] → [test] [good first bug]
Leaving it to some new developer who can use an easy way to familiarize with tests.
Assignee: g.maone → nobody
Maybe we could do something to naturally push for the correct order in the future?

One option, which I personally favor, would be to have `assertEq` take an object, like: 

assertEq({
 expected,
 actual,
 errorMessage, /* optional */
});
Giorgio, do you mind handling this? I agree this is easy, but I'm not sure it's a great first bug.

(In reply to Matthew Wein [:mattw] from comment #2)
> Maybe we could do something to naturally push for the correct order in the
> future?
> 
> One option, which I personally favor, would be to have `assertEq` take an
> object, like: 
> 
> assertEq({
>  expected,
>  actual,
>  errorMessage, /* optional */
> });

I think that gets a bit verbose when you have to look at it dozens of times in the same function.

In any case, this API is derived from a Chromium API, so there are drawbacks to changing the call contract.
Assignee: nobody → g.maone
Whiteboard: [test] [good first bug] → [test]
Whiteboard: [test] → [test] triaged
Component: WebExtensions: Untriaged → WebExtensions: General
Priority: P3 → P5
I fixed this in the refactoring in bug 1314492
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.