Skip to content

Commit 0522034

Browse files
committed
test: fix tests for contributors without BS credentials
1 parent 9d61348 commit 0522034

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/e2e/browserstack-send-status.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ module.exports = function sendStatus () {
2727

2828
return {
2929
beforeEach (browser, cb) {
30+
// avoid running if missing credentials
31+
if (!BS_USER || !BS_KEY) return cb()
3032
// retrieve the session and save it to the map
3133
const key = getKey(this.client)
3234
browser.session(({ sessionId }) => {
@@ -36,6 +38,8 @@ module.exports = function sendStatus () {
3638
},
3739

3840
afterEach (browser, cb) {
41+
// avoid running if missing credentials
42+
if (!BS_USER || !BS_KEY) return cb()
3943
const key = getKey(this.client)
4044
const { results } = this.client.currentTest
4145
const sessionId = sessionMap[key]

test/e2e/runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if (isLocal) {
8686
'Hey!\n',
8787
'You are missing credentials for Browserstack.\n',
8888
'If you are a contributor, this is normal, credentials are private. These tests must be run by a maintainer of vue-router',
89-
'If you are a maintainer, you forgot to `source keys.env`!'
89+
'If you are a maintainer, make sure to create your `.env` file with both `BS_USER` and `BS_KEY` variables!'
9090
)
9191
// fail if testing locally
9292
process.exit(process.env.isCI ? 0 : 1)

0 commit comments

Comments
 (0)