@@ -5,29 +5,32 @@ const {
5
5
} = require ( '../../../__fixtures__' )
6
6
const {
7
7
resetDatabase,
8
- addProject,
9
- addGithubOrg,
10
- addGithubRepo,
11
- addOSSFScorecardResult
8
+ initializeStore
12
9
} = require ( '../../../__utils__' )
13
10
const { github, ossf } = require ( '../../providers' )
14
11
15
12
exports . seed = async ( knex ) => {
16
13
// Clean up the database
17
14
await resetDatabase ( knex )
15
+ const {
16
+ addProject,
17
+ addGithubOrganization : addGithubOrg ,
18
+ addGithubRepo,
19
+ addOSSFScorecardResult,
20
+ } = initializeStore ( knex ) ;
18
21
19
22
// Add a project
20
- const project = await addProject ( knex , {
23
+ const [ project ] = await addProject ( {
21
24
name : 'github' ,
22
25
category : 'impact'
23
26
} )
24
27
25
28
// Add a GitHub organization
26
- const githubOrg = await addGithubOrg ( knex , { ...github . mappers . org ( sampleGithubOrg ) , project_id : project . id } )
29
+ const [ githubOrg ] = await addGithubOrg ( { ...github . mappers . org ( sampleGithubOrg ) , project_id : project . id } )
27
30
28
31
// Add GitHub repository
29
- const githubRepo = await addGithubRepo ( knex , { ...github . mappers . repo ( sampleGithubRepository ) , github_organization_id : githubOrg . id } )
32
+ const [ githubRepo ] = await addGithubRepo ( { ...github . mappers . repo ( sampleGithubRepository ) , github_organization_id : githubOrg . id } )
30
33
31
34
// Add OSSF Scorecard results
32
- await addOSSFScorecardResult ( knex , { ...ossf . mappers . result ( sampleOSSFScorecardResult ) , github_repository_id : githubRepo . id , analysis_execution_time : 19123 } )
35
+ await addOSSFScorecardResult ( { ...ossf . mappers . result ( sampleOSSFScorecardResult ) , github_repository_id : githubRepo . id , analysis_execution_time : 19123 } )
33
36
}
0 commit comments