function assertEqual(val, msg) {
  if (msg) flag(this, 'message', msg);
  let obj = flag(this, 'object');
  if (flag(this, 'deep')) {
    let prevLockSsfi = flag(this, 'lockSsfi');
    flag(this, 'lockSsfi', true);
    this.eql(val);
    flag(this, 'lockSsfi', prevLockSsfi);
  } else {
    this.assert(
      val === obj,
      'expected #{this} to equal #{exp}',
      'expected #{this} to not equal #{exp}',
      val,
      this._obj,
      true
    );
  }
}
### .equal(val[, msg])

Asserts that the target is strictly (`===`) equal to the given `val`.

    expect(1).to.equal(1);
    expect('foo').to.equal('foo');

Add `.deep` earlier in the chain to use deep equality instead. See the
`deep-eql` project page for info on the deep equality algorithm:
https://github.com/chaijs/deep-eql.

    // Target object deeply (but not strictly) equals `{a: 1}`
    expect({a: 1}).to.deep.equal({a: 1});
    expect({a: 1}).to.not.equal({a: 1});

    // Target array deeply (but not strictly) equals `[1, 2]`
    expect([1, 2]).to.deep.equal([1, 2]);
    expect([1, 2]).to.not.equal([1, 2]);

Add `.not` earlier in the chain to negate `.equal`. However, it's often
best to assert that the target is equal to its expected value, rather than
not equal to one of countless unexpected values.

    expect(1).to.equal(1); // Recommended
    expect(1).to.not.equal(2); // Not recommended

`.equal` accepts an optional `msg` argument which is a custom error message
to show when the assertion fails. The message can also be given as the
second argument to `expect`.

    expect(1).to.equal(2, 'nooo why fail??');
    expect(1, 'nooo why fail??').to.equal(2);

The aliases `.equals` and `eq` can be used interchangeably with `.equal`.

@name equal
@alias equals
@alias eq
@param {unknown} val
@param {string} msg _optional_
@namespace BDD
@public