@koralabs/kora-labs-common 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,9 +96,6 @@ class Environment {
96
96
  static getPotentialApplicationName() {
97
97
  var _a, _b;
98
98
  return __awaiter(this, void 0, void 0, function* () {
99
- if (process.env.NODE_ENV == 'test') {
100
- return null;
101
- }
102
99
  if (process.env.APPLICATION_NAME) {
103
100
  return process.env.APPLICATION_NAME;
104
101
  }
@@ -37,12 +37,17 @@ var LogCategory;
37
37
  class Logger {
38
38
  static initialize() {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
- if (!Logger.application) {
41
- const potentialName = yield environment_1.Environment.getPotentialApplicationName();
42
- if (!potentialName) {
43
- throw new Error("Logger.application must be set!");
40
+ if (process.env.NODE_ENV !== 'test') {
41
+ if (!Logger.application) {
42
+ const potentialName = yield environment_1.Environment.getPotentialApplicationName();
43
+ if (!potentialName) {
44
+ throw new Error('Logger.application must be set!');
45
+ }
46
+ Logger.application = potentialName;
44
47
  }
45
- Logger.application = potentialName;
48
+ }
49
+ else {
50
+ Logger.application = 'TEST';
46
51
  }
47
52
  Logger.isInitialized = true;
48
53
  });
@@ -17,6 +17,7 @@ describe('Logger Tests', () => {
17
17
  const obj = JSON.parse(call);
18
18
  expect(obj).toEqual({
19
19
  category: 'ERROR',
20
+ application: 'TEST',
20
21
  count: 1,
21
22
  dimensions: ['taco'],
22
23
  event: 'test.log',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koralabs/kora-labs-common",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Kora Labs Common Utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",