All users were logged out of Bugzilla on October 13th, 2018

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

RESOLVED DUPLICATE of bug 1314492

Status

P5
normal
RESOLVED DUPLICATE of bug 1314492
3 years ago
4 months ago

People

(Reporter: mao, Assigned: mao)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [test] triaged)

(Assignee)

Description

3 years ago
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.
(Assignee)

Updated

3 years ago
Whiteboard: [test] → [test] [good first bug]
(Assignee)

Comment 1

3 years ago
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]

Updated

3 years ago
Whiteboard: [test] → [test] triaged

Updated

2 years ago
Component: WebExtensions: Untriaged → WebExtensions: General
Priority: P3 → P5
I fixed this in the refactoring in bug 1314492
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1314492

Updated

4 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.