-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a0e230
commit 376b30f
Showing
2 changed files
with
49 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
const dsc = require('./index'); | ||
|
||
const dsc = require("./index"); | ||
|
||
/** Comparing 2 exact same strings returns 1 */ | ||
test('matching two equal strings', () => { | ||
expect(dsc.twoStrings('hello world', 'hello world')).toBe(1); | ||
test("matching two equal strings", () => { | ||
expect(dsc.twoStrings("hello world", "hello world")).toBe(1); | ||
}); | ||
|
||
|
||
/** Comparing 2 different strings returns ]0,1[ */ | ||
test('matching two different strings', () => { | ||
expect(dsc.twoStrings('hello world', 'hello world!')).toBeGreaterThan(0.9); | ||
expect(dsc.twoStrings('hello world', 'Hello es6')).toBeGreaterThan(0.4); | ||
test("matching two different strings", () => { | ||
expect(dsc.twoStrings("hello world", "hello world!")).toBeGreaterThan(0.9); | ||
expect(dsc.twoStrings("hello world", "Hello es6")).toBeGreaterThan(0.4); | ||
}); | ||
|
||
|
||
/** Comparing 2 two completely different strings returns 0 */ | ||
test('matching two different strings', () => { | ||
expect(dsc.twoStrings('hello world', 'es6')).toBe(0); | ||
}); | ||
test("matching two different strings", () => { | ||
expect(dsc.twoStrings("hello world", "es6")).toBe(0); | ||
}); |