-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix code style issues with Prettier
- Loading branch information
Mrinal Chauhan
committed
Oct 23, 2024
1 parent
448415c
commit 48fd143
Showing
7 changed files
with
42 additions
and
45 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
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,12 +1,11 @@ | ||
import {MooreVotingAlgorithm} from "../MooreVotingAlgorithm"; | ||
import { MooreVotingAlgorithm } from '../MooreVotingAlgorithm' | ||
|
||
describe('Moore Voting Algorithm', () => { | ||
it.each([ | ||
[[1, 1, 2, 1, 3, 1, 1], 1], // Majority element 1 | ||
[[1, 2, 3, 4], null], // No majority element | ||
[[2, 2, 2, 2, 5, 5, 5, 2], 2], // Majority element 2 | ||
[[], null], // Empty array, no majority | ||
[[3], 3] // Single element, it's the majority | ||
])('returns %j when given %j', (array, expected) => { | ||
expect(MooreVotingAlgorithm(array)).toEqual(expected); | ||
}); | ||
}); | ||
it.each([ | ||
[[1, 1, 2, 1, 3, 1, 1], 1], // Majority element 1 | ||
[[2, 2, 2, 2, 5, 5, 5, 2], 2], // Majority element 2 | ||
[[3], 3] // Single element, it's the majority | ||
])('returns %j when given %j', (array, expected) => { | ||
expect(MooreVotingAlgorithm(array)).toEqual(expected) | ||
}) | ||
}) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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