Added test for ScrambleStrings and formatted folder structure for other folders

This commit is contained in:
Omkarnath Parida
2021-10-03 17:28:17 +05:30
parent 255ef9a50d
commit c198a9f53d
12 changed files with 26 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import { haversineDistance } from './Haversine'
import { haversineDistance } from '../Haversine'
describe('Testing the haversine distance calculator', () => {
it('Calculate distance', () => {

View File

@ -1,4 +1,4 @@
import { quickSort } from './QuickSortRecursive'
import { quickSort } from '../QuickSortRecursive'
describe('QuickSortRecursive | Partition In Place Method', () => {
it('Expectedly, throw some error if we pass a non-array input', () => {

View File

@ -1,4 +1,4 @@
import { selectionSort } from './SelectionSort'
import { selectionSort } from '../SelectionSort'
describe('selectionSort', () => {
it('expects to return the array sorted in ascending order', () => {

View File

@ -47,4 +47,4 @@ const helper = function (dp, s1, s2) {
return false
}
console.log(isScramble('great', 'rgeat'))
export { isScramble }

View File

@ -1,4 +1,4 @@
import { checkVowels } from './CheckVowels'
import { checkVowels } from '../CheckVowels'
describe('Test the checkVowels function', () => {
it('expect throws on use wrong param', () => {

View File

@ -1,4 +1,4 @@
import { checkWordOccurrence } from './CheckWordOccurrence'
import { checkWordOccurrence } from '../CheckWordOccurrence'
describe('checkWordOccurrence', () => {
it('expects throw on insert wrong string', () => {
const value = 123

View File

@ -1,4 +1,4 @@
import { formatPhoneNumber } from './FormatPhoneNumber'
import { formatPhoneNumber } from '../FormatPhoneNumber'
describe('PhoneNumberFormatting', () => {
it('expects to return the formatted phone number', () => {

View File

@ -1,4 +1,4 @@
import { levenshteinDistance } from './LevenshteinDistance'
import { levenshteinDistance } from '../LevenshteinDistance'
describe('levenshteinDistance', () => {
it('should calculate edit distance between two strings', () => {

View File

@ -1,4 +1,4 @@
import { maxCharacter } from './MaxCharacter'
import { maxCharacter } from '../MaxCharacter'
describe('Testing the maxCharacter function', () => {
it('Expect throw with wrong arg', () => {

View File

@ -1,4 +1,4 @@
import { permutate } from './PermutateString'
import { permutate } from '../PermutateString'
describe('Permutate a string', () => {
it('expects to throw an Error with an empty string', () => {

View 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)
})
})

View File

@ -1,4 +1,4 @@
import { getMonthDays } from './GetMonthDays'
import { getMonthDays } from '../GetMonthDays'
describe('Get the Days of a Month', () => {
it('expects to return 28', () => {