Replace faker.random.word by faker.word.sample

This commit is contained in:
Koen Vlaswinkel
2023-06-08 12:50:42 +02:00
parent a4f90b7197
commit bbffc16b64
7 changed files with 9 additions and 9 deletions

View File

@@ -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,
})}`,
},

View File

@@ -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,

View File

@@ -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,

View File

@@ -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(),
};
}

View File

@@ -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 {

View File

@@ -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()}`,
},
],
};

View File

@@ -197,7 +197,7 @@ describe(processVariantAnalysisRepositoryTask.name, () => {
describe(processScannedRepository.name, () => {
const mockApiResponse = createMockScannedRepo(
faker.random.word(),
faker.word.sample(),
faker.datatype.boolean(),
VariantAnalysisRepoStatus.Pending,
);