assertShipEngineError(error, props) {
    props.name = props.name || "ShipEngineError";

    expect(error).to.be.an.instanceOf(Error);
    expect(error).to.be.an.instanceOf(ShipEngineError);
    expect(error.name)
      .to.be.a("string")
      .equal(props.name)
      .equal(error.constructor.name)
      .with.length.above(0);
    expect(error.source)
      .to.be.a("string")
      .equal(props.source)
      .with.length.above(0);
    expect(error.type).to.be.a("string").equal(props.type).with.length.above(0);
    expect(error.code).to.be.a("string").equal(props.code).with.length.above(0);

    expect(error.url).to.be.an.instanceOf(URL);
    if (props.url) {
      expect(error.url).to.have.property("href", props.url);
    }

    if ("requestID" in props) {
      expect(error.requestID).to.equal(props.requestID);
    }

    expect(error.message).to.be.a("string").with.length.above(0);
    if (props.message instanceof RegExp) {
      expect(error.message).to.match(props.message);
    } else {
      expect(error.message).to.equal(props.message);
    }
  }
/**
   * Asserts that an error is a valid ShipEngineError with the expected values
   */
Asserts that an error is a valid ShipEngineError with the expected values
Asserts that an error is a valid ShipEngineError with the expected values
assertShipEngineError(error, props) {
    props.name = props.name || "ShipEngineError";
    expect(error).to.be.an.instanceOf(Error);
    expect(error).to.be.an.instanceOf(ShipEngineError);
    expect(error.name)
      .to.be.a("string")
      .equal(props.name)
      .equal(error.constructor.name)
      .with.length.above(0);
    expect(error.source)
      .to.be.a("string")
      .equal(props.source)
      .with.length.above(0);
    expect(error.type).to.be.a("string").equal(props.type).with.length.above(0);
    expect(error.code).to.be.a("string").equal(props.code).with.length.above(0);
    expect(error.url).to.be.an.instanceOf(URL);
    if (props.url) {
      expect(error.url).to.have.property("href", props.url);
    }
    if ("requestID" in props) {
      expect(error.requestID).to.equal(props.requestID);
    }
    expect(error.message).to.be.a("string").with.length.above(0);
    if (props.message instanceof RegExp) {
      expect(error.message).to.match(props.message);
    } else {
      expect(error.message).to.equal(props.message);
    }
  }
assertShipEngineError ( error , props ) { props . name = props . name || "ShipEngineError" ; expect ( error ) . to . be . an . instanceOf ( Error ) ; expect ( error ) . to . be . an . instanceOf ( ShipEngineError ) ; expect ( error . name ) . to . be . a ( "string" ) . equal ( props . name ) . equal ( error . constructor . name ) . with . length . above ( 0 ) ; expect ( error . source ) . to . be . a ( "string" ) . equal ( props . source ) . with . length . above ( 0 ) ; expect ( error . type ) . to . be . a ( "string" ) . equal ( props . type ) . with . length . above ( 0 ) ; expect ( error . code ) . to . be . a ( "string" ) . equal ( props . code ) . with . length . above ( 0 ) ; expect ( error . url ) . to . be . an . instanceOf ( URL ) ; if ( props . url ) { expect ( error . url ) . to . have . property ( "href" , props . url ) ; } if ( "requestID" in props ) { expect ( error . requestID ) . to . equal ( props . requestID ) ; } expect ( error . message ) . to . be . a ( "string" ) . with . length . above ( 0 ) ; if ( props . message instanceof RegExp ) { expect ( error . message ) . to . match ( props . message ) ; } else { expect ( error . message ) . to . equal ( props . message ) ; } }
Asserts that an error is a valid ShipEngineError with the expected values
Asserts that an error is a valid ShipEngineError with the expected values