Skip to content

Commit

Permalink
test(cz-git): adjust test file for fuzzy search
Browse files Browse the repository at this point in the history
link #22
  • Loading branch information
Zhengqbbb committed Apr 30, 2022
1 parent b82fbf9 commit f15ea52
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/cz-git/__tests__/generateQuestions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ describe("generateQuestions()", () => {
expect(mockTypesSourceFn({}, "f")).toEqual([
{
value: "feat",
name: "feat: this is a feature"
name: "feat: this is a feature",
index: 0,
score: 1
}
]);

Expand All @@ -57,9 +59,15 @@ describe("generateQuestions()", () => {
{},
{ name: "cz-git", value: "cz-git" }
]);
expect(mockTypesSourceFn({}, "cz")).toEqual([{ name: "cz-git", value: "cz-git" }]);
expect(mockTypesSourceFn({}, "em")).toEqual([{ name: "empty", value: false }]);
expect(mockTypesSourceFn({}, "cu")).toEqual([{ name: "custom", value: "___CUSTOM___" }]);
expect(mockTypesSourceFn({}, "cz")).toEqual([
{ name: "cz-git", value: "cz-git", index: 3, score: 4 }
]);
expect(mockTypesSourceFn({}, "em")).toEqual([
{ name: "empty", value: false, index: 0, score: 4 }
]);
expect(mockTypesSourceFn({}, "cu")).toEqual([
{ name: "custom", value: "___CUSTOM___", index: 1, score: 4 }
]);
expect(mockTypesSourceFn({}, "aaa")).toEqual([]);
});
});

0 comments on commit f15ea52

Please sign in to comment.