Add logged Faker seed when none is set in tests (#9140)

This will hopefully make it easier to reproduce test failures
that happen intermittently, especially in CI.
This commit is contained in:
Buck Doyle 2020-10-22 13:45:51 -05:00 committed by GitHub
parent 059e87c862
commit 8aacab513b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,10 @@ if (config.environment !== 'test' || searchIncludesSeed) {
} else { } else {
faker.seed(1); faker.seed(1);
} }
} else if (config.environment === 'test') {
const randomSeed = faker.random.number();
console.log(`No seed specified with faker-seed query parameter, seeding Faker with ${randomSeed}`);
faker.seed(randomSeed);
} }
export default faker; export default faker;