FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScript/Ciphers/test/CaesarCipher.test.js at master · TheAlgorithms/JavaScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
TheAlgorithms
/
JavaScript
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
5.8k
Star
34.2k
Code
Issues
21
Pull requests
192
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScript
/
Ciphers
/
test
/
CaesarCipher.test.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (20 loc) · 826 Bytes
Breadcrumbs
JavaScript
/
Ciphers
/
test
/
CaesarCipher.test.js
Copy path
File metadata and controls
22 lines (20 loc) · 826 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import
caesarCipher
from
'../CaesarCipher'
describe
(
'Testing the caesarsCipher function'
,
(
)
=>
{
it
(
'Test - 1, Testing for invalid types'
,
(
)
=>
{
expect
(
(
)
=>
caesarCipher
(
false
,
3
)
)
.
toThrow
(
)
expect
(
(
)
=>
caesarCipher
(
'false'
,
-
1
)
)
.
toThrow
(
)
expect
(
(
)
=>
caesarCipher
(
'true'
,
null
)
)
.
toThrow
(
)
}
)
it
(
'Test - 2, Testing for valid string and rotation'
,
(
)
=>
{
expect
(
caesarCipher
(
'middle-Outz'
,
2
)
)
.
toBe
(
'okffng-Qwvb'
)
expect
(
caesarCipher
(
'abcdefghijklmnopqrstuvwxyz'
,
3
)
)
.
toBe
(
'defghijklmnopqrstuvwxyzabc'
)
expect
(
caesarCipher
(
'Always-Look-on-the-Bright-Side-of-Life'
,
5
)
)
.
toBe
(
'Fqbfdx-Qttp-ts-ymj-Gwnlmy-Xnij-tk-Qnkj'
)
expect
(
caesarCipher
(
'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG'
,
23
)
)
.
toBe
(
'QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD'
)
}
)
}
)
Back
|
FazBrowse Home
|
New Git URL