Sha256: 7c1e71548bb3c6d638beebfeeefee1401fc70bfad43feb92547dfe125e578d4f

Contents?: true

Size: 1.19 KB

Versions: 185

Compression:

Stored size: 1.19 KB

Contents

import Transcriptor from './rna-transcription';

describe('Transcriptor', () => {
  const transcriptor = new Transcriptor();

  test('transcribes cytosine to guanine', () => {
    expect(transcriptor.toRna('C')).toEqual('G');
  });

  xtest('transcribes guanine to cytosine', () => {
    expect(transcriptor.toRna('G')).toEqual('C');
  });

  xtest('transcribes adenine to uracil', () => {
    expect(transcriptor.toRna('A')).toEqual('U');
  });

  xtest('transcribes thymine to adenine', () => {
    expect(transcriptor.toRna('T')).toEqual('A');
  });

  xtest('transcribes all dna nucleotides to their rna complements', () => {
    expect(transcriptor.toRna('ACGTGGTCTTAA'))
        .toEqual('UGCACCAGAAUU');
  });

  xtest('correctly handles invalid input', () => {
    expect(() => transcriptor.toRna('U')).toThrow(
      new Error('Invalid input DNA.'),
    );
  });

  xtest('correctly handles completely invalid input', () => {
    expect(() => transcriptor.toRna('XXX')).toThrow(
      new Error('Invalid input DNA.'),
    );
  });

  xtest('correctly handles partially invalid input', () => {
    expect(() => transcriptor.toRna('ACGTXXXCTTAA')).toThrow(
      new Error('Invalid input DNA.'),
    );
  });
});

Version data entries

185 entries across 185 versions & 1 rubygems

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