• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #13207

pending completion
#13207

push

circleci

toufali
use ESBuild to define env vars in client

282 of 1633 branches covered (17.27%)

Branch coverage included in aggregate %.

13 of 13 new or added lines in 2 files covered. (100.0%)

959 of 4397 relevant lines covered (21.81%)

1.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/client/js/app-constants.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
// PUBLIC APP CONSTANTS – DO NOT ADD SECRETS HERE
6

7
/* During build-phase (npm start), ESBuild creates `buildConstants` as defined in esbuild.js, which include server env vars.
8
These are merged into client AppConstants and exported.
9

10
When app is run via `npm run dev`, ESBuild does not run and `buildConstants` is undefined.
11
For this case, we can add fallback vars to AppConstants if needed for testing. */
12

13
/* global buildConstants */
14

15
const AppConstants = {}
×
16

17
if (typeof buildConstants === 'object') {
×
18
  // Build-phase has run (npm start) and ESBuild defined `buildConstants` object
19
  Object.assign(AppConstants, buildConstants)
×
20
} else {
21
  // Build-phase was not run (npm run dev). Assign fallbacks for testing if needed.
22
  Object.assign(AppConstants, {
×
23
    GA4_MEASUREMENT_ID: 'G-CXG8K4KW4P'
24
  })
25
  console.log('Skipped build-phase. Using default/fallback values for AppConstants.', AppConstants)
×
26
}
27

28
export default Object.freeze(AppConstants)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc