Skip to content

Commit d00a7bf

Browse files
committed
test: added two test cases
1 parent 5cedaa9 commit d00a7bf

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Ciphers/test/Atbash.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Atbash from '../Atbash'
2+
3+
describe('Testing Atbash function', () => {
4+
it('Test - 1, passing the non-string as an argument', () => {
5+
expect(() => Atbash(0x345)).toThrow()
6+
expect(() => Atbash(123)).toThrow()
7+
expect(() => Atbash(123n)).toThrow()
8+
expect(() => Atbash(false)).toThrow()
9+
expect(() => Atbash({})).toThrow()
10+
expect(() => Atbash([])).toThrow()
11+
})
12+
13+
it('Test - 2, passing all alphabets', () => {
14+
expect(Atbash('HELLO WORLD')).toBe('SVOOL DLIOW')
15+
expect(Atbash('The quick brown fox jumps over the lazy dog')).toBe('Gsv jfrxp yildm ulc qfnkh levi gsv ozab wlt')
16+
})
17+
})

0 commit comments

Comments
 (0)