mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
Added test for ScrambleStrings and formatted folder structure for other folders
This commit is contained in:
15
String/test/ScrambleStrings.test.js
Normal file
15
String/test/ScrambleStrings.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isScramble } from '../ScrambleStrings'
|
||||
|
||||
describe('ScrambleStrings', () => {
|
||||
it('expects to return true for same string', () => {
|
||||
expect(isScramble('a', 'a')).toBe(true)
|
||||
})
|
||||
|
||||
it('expects to return false for non-scrambled strings', () => {
|
||||
expect(isScramble('abcde', 'caebd')).toBe(false)
|
||||
})
|
||||
|
||||
it('expects to return true for scrambled strings', () => {
|
||||
expect(isScramble('great', 'rgeat')).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user