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.58 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.57 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.56 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.55 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.54 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.53 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.52 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.51 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.50 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.49 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.48 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.47 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.46 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.45 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.44 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.43 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.42 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.41 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.40 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.39 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js