Sha256: e5c8a98cfb74e3b7621a2110bd23758a0b46ba7cb1c68e781a3f2a1ee0b08d95

Contents?: true

Size: 1.33 KB

Versions: 255

Compression:

Stored size: 1.33 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

255 entries across 255 versions & 1 rubygems

Version Path
trackler-2.2.1.37 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.36 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.35 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.34 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.33 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.32 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.31 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.30 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.29 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.28 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.27 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.26 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.25 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.24 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.23 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.22 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.21 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.20 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.19 tracks/javascript/exercises/point-mutations/point-mutations.spec.js
trackler-2.2.1.18 tracks/javascript/exercises/point-mutations/point-mutations.spec.js