InitialState now accepts optional refs, commits, issues, and
pullRequests arrays. They default to empty arrays, so existing fixtures do
not need to change.
simulation({
initialState: {
users: [],
organizations: [{login: 'acme'}],
repositories: [{owner: 'acme', name: 'awesome-repo'}],
branches: [{owner: 'acme', repo: 'awesome-repo', name: 'main'}],
blobs: [],
commits: [{owner: 'acme', repo: 'awesome-repo', sha: 'abc123'}],
refs: [
{
owner: 'acme',
repo: 'awesome-repo',
qualifiedName: 'main',
object: {sha: 'abc123'}
}
],
issues: [{owner: 'acme', repo: 'awesome-repo', number: 1, title: 'Bug'}],
pullRequests: [
{
owner: 'acme',
repo: 'awesome-repo',
number: 2,
title: 'Fix bug',
base: {ref: 'main', sha: 'abc123'},
head: {ref: 'feature/fix', sha: 'def456'}
}
]
}
});
Seeded refs, commits, issues, and pull requests are visible through the
documented REST endpoints and through repository GraphQL fields such as
defaultBranchRef, ref, issues, and pullRequests.