Replace faker.random.word by faker.word.sample
This commit is contained in:
@@ -142,7 +142,7 @@ const manyScannedRepos = Array.from({ length: 1000 }, (_, i) => {
|
||||
id: faker.helpers.unique(faker.number.int, [], {
|
||||
store: uniqueStore,
|
||||
}),
|
||||
fullName: `octodemo/${faker.helpers.unique(faker.random.word, [], {
|
||||
fullName: `octodemo/${faker.helpers.unique(faker.word.sample, [], {
|
||||
store: uniqueStore,
|
||||
})}`,
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
RepositoryWithMetadata,
|
||||
} from "../../../../src/variant-analysis/gh-api/repository";
|
||||
|
||||
export function createMockRepository(name = faker.random.word()): Repository {
|
||||
export function createMockRepository(name = faker.word.sample()): Repository {
|
||||
return {
|
||||
id: faker.number.int(),
|
||||
name,
|
||||
|
||||
@@ -26,8 +26,8 @@ export function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGr
|
||||
}
|
||||
|
||||
export function createMockNotFoundSkippedRepoGroup(): VariantAnalysisNotFoundRepositoryGroup {
|
||||
const repoName1 = `github/${faker.random.word()}`;
|
||||
const repoName2 = `github/${faker.random.word()}`;
|
||||
const repoName1 = `github/${faker.word.sample()}`;
|
||||
const repoName2 = `github/${faker.word.sample()}`;
|
||||
|
||||
return {
|
||||
repository_count: 2,
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
export function createMockRepository(): Repository {
|
||||
return {
|
||||
id: faker.number.int(),
|
||||
fullName: `github/${faker.random.word()}`,
|
||||
fullName: `github/${faker.word.sample()}`,
|
||||
private: faker.datatype.boolean(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import { createMockRepositoryWithMetadata } from "./repository";
|
||||
|
||||
export function createMockScannedRepo(
|
||||
name: string = faker.random.word(),
|
||||
name: string = faker.word.sample(),
|
||||
isPrivate: boolean = faker.datatype.boolean(),
|
||||
analysisStatus: VariantAnalysisRepoStatus = VariantAnalysisRepoStatus.Pending,
|
||||
): VariantAnalysisScannedRepository {
|
||||
|
||||
@@ -29,10 +29,10 @@ export function createMockNotFoundRepoGroup(): VariantAnalysisSkippedRepositoryG
|
||||
repositoryCount: 2,
|
||||
repositories: [
|
||||
{
|
||||
fullName: `github/${faker.random.word()}`,
|
||||
fullName: `github/${faker.word.sample()}`,
|
||||
},
|
||||
{
|
||||
fullName: `github/${faker.random.word()}`,
|
||||
fullName: `github/${faker.word.sample()}`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -197,7 +197,7 @@ describe(processVariantAnalysisRepositoryTask.name, () => {
|
||||
|
||||
describe(processScannedRepository.name, () => {
|
||||
const mockApiResponse = createMockScannedRepo(
|
||||
faker.random.word(),
|
||||
faker.word.sample(),
|
||||
faker.datatype.boolean(),
|
||||
VariantAnalysisRepoStatus.Pending,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user