Skip to content

Commit f78282a

Browse files
committed
Validate that config file exists.
1 parent d83b22e commit f78282a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/vertexai/karma.conf.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717

1818
const karmaBase = require('../../config/karma.base');
1919
const { argv } = require('yargs');
20+
const { existsSync } = require('fs');
2021

21-
// Validate that required environment variables are defined
22-
if (!process.env.VERTEXAI_INTEGRATION_FIREBASE_CONFIG_JSON) {
23-
throw new Error('VERTEXAI_INTEGRATION_FIREBASE_CONFIG_JSON is not defined in env. Set this env variable to be the JSON of a Firebase project config to run the integration tests with.')
22+
// Validate that the file that defines the Firebase config to be used in the integration tests exists.
23+
if (argv.integration) {
24+
if (!existsSync('integration/firebase-config.ts')) {
25+
throw new Error(`integration/firebase-config.ts does not exist. This file must contain a Firebase config for a project with Vertex AI enabled.`)
26+
}
2427
}
2528

2629
module.exports = function (config) {

0 commit comments

Comments
 (0)