packages/enos-sdk-samples/src/tests/subsuite_factory/connection_factory.js
/**
 * generate connection close suite
 *
 * @param {DeviceClient} client
 */
generate connection close suite
@param {DeviceClient} client
generate connection close suite @param { DeviceClient } client
function connectionCloseSuiteFactory(client) {
  describe('Client close connection', () => {
    it('should close successfully', async() => {
      client.on('close', () => {
        expect(client.connected).toBe(false);
      });
      client.on('end', () => {
        expect(client.connected).toBe(false);
      });
      expect(client.connected).toBe(true);
      await client.close();
      expect(client.connected).toBe(false);
    });
  });
}
function connectionCloseSuiteFactory ( client ) { describe ( 'Client close connection' , ( ) => { it ( 'should close successfully' , async ( ) => { client . on ( 'close' , ( ) => { expect ( client . connected ) . toBe ( false ) ; } ) ; client . on ( 'end' , ( ) => { expect ( client . connected ) . toBe ( false ) ; } ) ; expect ( client . connected ) . toBe ( true ) ; await client . close ( ) ; expect ( client . connected ) . toBe ( false ) ; } ) ; } ) ; }
generate connection close suite
 @param {DeviceClient} client
generate connection close suite @param { DeviceClient } client