Skip to content

Commit 8cdef23

Browse files
committed
1 parent 0965f9b commit 8cdef23

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.aegir.cjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@ module.exports = {
2424
test: {
2525
cov: false,
2626
async before () {
27-
return new MockServerController()
27+
return {
28+
env: {
29+
MOCK_PINNING_SERVER_SECRET: 'ci',
30+
},
31+
controller: new MockServerController(),
32+
}
2833
},
2934
/**
3035
*
3136
* @param {GlobalOptions & TestOptions} _
3237
* @param {MockServerController} controller
3338
*/
34-
async after (_, controller) {
39+
async after (_, {controller}) {
3540
await controller.shutdown()
3641
}
3742
}

test/MockServer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import portscanner from 'portscanner'
55
import cors from 'cors'
66
import { logger } from './logger'
77

8-
import('dotenvrc')
8+
try {
9+
import('dotenvrc')
10+
} catch (err) {
11+
// no dotenvrc.. that's okay
12+
// eslint-disable-next-line no-console
13+
console.warn('No .envrc file found; assuming CI environment. If not: You should copy .envrc-copy and set your environment variables.')
14+
}
915

1016
export class MockServer {
1117
private _server: Server | undefined = undefined

0 commit comments

Comments
 (0)