Sha256: 7b1d14e62d7023896e4270cc0233e02631d8eb0a71cd9b3358bf034f800742eb

Contents?: true

Size: 1.34 KB

Versions: 141

Compression:

Stored size: 1.34 KB

Contents

var DNA = require('./point-mutations');

describe('DNA', function () {
  it('no difference between empty strands', function () {
    var dna = new DNA('');
    expect(dna.hammingDistance('')).toEqual(0);
  });

  xit('no difference between identical strands', function () {
    var dna = new DNA('GGACTGA');
    expect(dna.hammingDistance('GGACTGA')).toEqual(0);
  });

  xit('complete hamming distance in small strand', function () {
    var dna = new DNA('ACT');
    expect(dna.hammingDistance('GGA')).toEqual(3);
  });

  xit('hamming distance in off by one strand', function () {
    var dna = new DNA('GGACGGATTCTGACCTGGACTAATTTTGGGG');
    expect(dna.hammingDistance('AGGACGGATTCTGACCTGGACTAATTTTGGGG')).toEqual(19);
  });

  xit('small hamming distance in middle somewhere', function () {
    var dna = new DNA('GGACG');
    expect(dna.hammingDistance('GGTCG')).toEqual(1);
  });

  xit('larger distance', function () {
    var dna = new DNA('ACCAGGG');
    expect(dna.hammingDistance('ACTATGG')).toEqual(2);
  });

  xit('shortens other strand when longer', function () {
    var dna = new DNA('AAACTAGGGG');
    expect(dna.hammingDistance('AGGCTAGCGGTAGGAC')).toEqual(3);
  });

  xit('shortens original strand when longer', function () {
    var dna = new DNA('GACTACGGACAGGGTAGGGAAT');
    expect(dna.hammingDistance('GACATCGCACACC')).toEqual(5);
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

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