Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Ciphers/test/Atbash.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Atbash from '../Atbash'

describe('Testing Atbash function', () => {
it('Test - 1, passing the non-string as an argument', () => {
it('Test - 1, passing a non-string as an argument', () => {
expect(() => Atbash(0x345)).toThrow()
expect(() => Atbash(123)).toThrow()
expect(() => Atbash(123n)).toThrow()
Expand All @@ -10,8 +10,9 @@ describe('Testing Atbash function', () => {
expect(() => Atbash([])).toThrow()
})

it('Test - 2, passing all alphabets', () => {
expect(Atbash('HELLO WORLD')).toBe('SVOOL DLIOW')
expect(Atbash('The quick brown fox jumps over the lazy dog')).toBe('Gsv jfrxp yildm ulc qfnkh levi gsv ozab wlt')
it('Test - 2, passing a string as an argument', () => {
const clearText = 'The quick brown fox jumps over the lazy dog'
const cryptText = Atbash(clearText)
expect(Atbash(cryptText)).toBe(clearText)
})
})