Sha256: 7efeefa4ae64534210d834c1512c8dd912aa1451924fae5dad7c8caddcaf8f65

Contents?: true

Size: 1.57 KB

Versions: 185

Compression:

Stored size: 1.57 KB

Contents

import SecretHandshake from './secret-handshake';

describe('Secret Handshake', () => {
  test('binary 1 (hexadecimal 0x01) is a wink', () => {
    const handshake = new SecretHandshake(0x01);
    expect(handshake.commands()).toEqual(['wink']);
  });

  xtest('binary 10 (hexadecimal 0x02) is a double blink', () => {
    const handshake = new SecretHandshake(0x02);
    expect(handshake.commands()).toEqual(['double blink']);
  });

  xtest('binary 100 (hexadecimal 0x04) is close your eyes', () => {
    const handshake = new SecretHandshake(0x04);
    expect(handshake.commands()).toEqual(['close your eyes']);
  });

  xtest('binary 1000 (hexadecimal 0x08) is jump', () => {
    const handshake = new SecretHandshake(0x08);
    expect(handshake.commands()).toEqual(['jump']);
  });

  xtest('binary 11 (hexadecimal 0x03) is wink and double blink', () => {
    const handshake = new SecretHandshake(0x03);
    expect(handshake.commands()).toEqual(['wink', 'double blink']);
  });

  xtest('binary 10011 (hexadecimal 0x13) is double blink and wink', () => {
    const handshake = new SecretHandshake(0x13);
    expect(handshake.commands()).toEqual(['double blink', 'wink']);
  });

  xtest('binary 11111 (hexadecimal 0x1F) is jump, close your eyes, double blink, and wink', () => {
    const handshake = new SecretHandshake(0x1F);
    expect(handshake.commands()).toEqual(['jump', 'close your eyes', 'double blink', 'wink']);
  });

  xtest('text is an invalid secret handshake', () => {
    expect(() => new SecretHandshake('piggies'))
      .toThrow(new Error('Handshake must be a number'));
  });
});

Version data entries

185 entries across 185 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.179 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.178 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.177 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.176 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.175 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.174 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.173 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.172 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.171 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.170 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.169 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.167 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.166 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.165 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.164 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.163 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.162 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.161 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js
trackler-2.2.1.160 tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js