Sha256: f90c8493480ca00b36a6faac7eabecf004d714823e94a55acaefcc9194c4f390
Contents?: true
Size: 1.79 KB
Versions: 123
Compression:
Stored size: 1.79 KB
Contents
import translate from './protein-translation'; describe('ProteinTranslation', () => { test('Empty RNA has no proteins', () => { expect(translate()).toEqual([]); }); xtest('Methionine codon translates into protein', () => { expect(translate('AUG')).toEqual(['Methionine']); }); xtest('Phenylalanine codons translate into protein', () => { expect(translate('UUUUUC')).toEqual(['Phenylalanine', 'Phenylalanine']); }); xtest('Leucine codons translate into protein', () => { expect(translate('UUAUUG')).toEqual(['Leucine', 'Leucine']); }); xtest('Serine codons translate into protein', () => { expect(translate('UCUUCCUCAUCG')).toEqual(['Serine', 'Serine', 'Serine', 'Serine']); }); xtest('Tyrosine codons translate into protein', () => { expect(translate('UAUUAC')).toEqual(['Tyrosine', 'Tyrosine']); }); xtest('Cysteine codons translate into protein', () => { expect(translate('UGUUGC')).toEqual(['Cysteine', 'Cysteine']); }); xtest('Tryptophan codon translates into protein', () => { expect(translate('UGG')).toEqual(['Tryptophan']); }); xtest('Sequence starts with stop codon 1', () => { expect(translate('UAAUUUUUA')).toEqual([]); }); xtest('Sequence starts with stop codon 2', () => { expect(translate('UAGAUGUAU')).toEqual([]); }); xtest('Sequence starts with stop codon 3', () => { expect(translate('UGAUGU')).toEqual([]); }); xtest('Small RNA strand', () => { expect(translate('AUGUUUUCU')).toEqual(['Methionine', 'Phenylalanine', 'Serine']); }); xtest('Stop codon ends translation', () => { expect(translate('AUGUUUUCUUAAAUG')).toEqual(['Methionine', 'Phenylalanine', 'Serine']); }); xtest('Invalid codon throws error', () => { expect(() => translate('LOL')).toThrow(new Error('Invalid codon')); }); });
Version data entries
123 entries across 123 versions & 1 rubygems