Skip to content

Commit 242c050

Browse files
authored
Fix derived branch name default. (#143)
The previous default didn't work if the variable had an empty String as value.
1 parent 9400899 commit 242c050

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/e2e/utils/env.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
function getEnv() {
2-
const { GITHUB_HEAD_REF: branch = 'main' } = process.env;
2+
let { GITHUB_HEAD_REF: branch } = process.env;
3+
if (!branch) {
4+
branch = 'main';
5+
}
36
return branch === 'local' ? 'http://localhost:3000' : `https://${branch}--da-live--adobe.hlx.live`;
47
}
58

test/e2e/utils/page.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export function getTestSheetURL(testIdentifier, workerInfo) {
4646
* @returns The age in ms or null if the file name does not match the pattern.
4747
*/
4848
export function getTestResourceAge(fileName) {
49-
const re = /pw-\w+(-t1)*-(\w+)-\w+/;
49+
const re = /pw-\w+-(\w+)-\w+/;
5050
const res = re.exec(fileName);
5151
if (res) {
52-
return parseInt(res[2], 36);
52+
return parseInt(res[1], 36);
5353
}
5454
return null;
5555
}

0 commit comments

Comments
 (0)