Sha256: 139024f569e41dafcce55f7c6f24886de201289224d1dd9c46c99c74fbb4deec

Contents?: true

Size: 1.89 KB

Versions: 132

Compression:

Stored size: 1.89 KB

Contents

var translate = require('./protein-translation');

describe('ProteinTranslation', function () {
  it('Empty RNA has no proteins', function () {
    expect(translate()).toEqual([]);
  });

  xit('Methionine codon translates into protein', function () {
    expect(translate('AUG')).toEqual(['Methionine']);
  });

  xit('Phenylalanine codons translate into protein', function () {
    expect(translate('UUUUUC')).toEqual(['Phenylalanine', 'Phenylalanine']);
  });

  xit('Leucine codons translate into protein', function () {
    expect(translate('UUAUUG')).toEqual(['Leucine', 'Leucine']);
  });

  xit('Serine codons translate into protein', function () {
    expect(translate('UCUUCCUCAUCG')).toEqual(['Serine', 'Serine', 'Serine', 'Serine']);
  });

  xit('Tyrosine codons translate into protein', function () {
    expect(translate('UAUUAC')).toEqual(['Tyrosine', 'Tyrosine']);
  });

  xit('Cysteine codons translate into protein', function () {
    expect(translate('UGUUGC')).toEqual(['Cysteine', 'Cysteine']);
  });

  xit('Tryptophan codon translates into protein', function () {
    expect(translate('UGG')).toEqual(['Tryptophan']);
  });

  xit('Sequence starts with stop codon 1', function () {
    expect(translate('UAAUUUUUA')).toEqual([]);
  });

  xit('Sequence starts with stop codon 2', function () {
    expect(translate('UAGAUGUAU')).toEqual([]);
  });

  xit('Sequence starts with stop codon 3', function () {
    expect(translate('UGAUGU')).toEqual([]);
  });

  xit('Small RNA strand', function () {
    expect(translate('AUGUUUUCU')).toEqual(['Methionine', 'Phenylalanine', 'Serine']);
  });

  xit('Stop codon ends translation', function () {
    expect(translate('AUGUUUUCUUAAAUG')).toEqual(['Methionine', 'Phenylalanine', 'Serine']);
  });

  xit('Invalid codon throws error', function () {
    expect(
      function () {
        translate('LOL');
      }
    ).toThrow(new Error('Invalid codon'));
  });
});

Version data entries

132 entries across 132 versions & 1 rubygems

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