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.159 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.158 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.157 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.156 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.155 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.154 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.153 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.152 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.151 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.150 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.149 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.148 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.147 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.146 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.145 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.144 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.143 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.142 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.141 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js
trackler-2.2.1.140 tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js