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.98 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.97 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.96 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.95 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.94 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.93 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.92 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.91 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.90 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.89 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.88 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.87 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.86 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.85 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.84 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.83 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.82 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.81 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.80 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.79 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js