Instead of the two if blocks, you could probably either do

    expect(uri1).to.be(uri2);

or

    expect(uri1 || null).toBe(uri2 || null);