Skip to content

Commit b862c76

Browse files
committed
Readd error on bun test when enviroment variable BRANCH is not set
1 parent a283407 commit b862c76

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

build/tests/input.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { expect, describe, test } from 'bun:test'
22
import { InputLocations } from '../src/types'
33
import { gitReadFunc } from '../src/git'
44

5+
const branch = process.env['BRANCH']
6+
if (!branch) throw new Error('enviroment variable BRANCH is not set!')
57
const inputLocationsPromise: Promise<InputLocations> = await gitReadFunc(
6-
process.env['BRANCH']!,
8+
branch,
79
'input-locations.json'
810
).then(data => JSON.parse(data!))
911

build/tests/npDatabase.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
import { getRepoBranches, gitReadFunc } from '../src/git'
1515

1616
async function loadNpDatabases() {
17-
const branch = process.env['BRANCH']!
17+
const branch = process.env['BRANCH']
18+
if (!branch) throw new Error('enviroment variable BRANCH is not set!')
1819

1920
const npDatabasePromise = gitReadFunc(branch, 'npDatabase.min.json').then(
2021
data => JSON.parse(data!) as PackageDB

0 commit comments

Comments
 (0)