@terreno/test 0.26.0 → 0.27.0

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.
@@ -40,6 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.registerLogSilencing = exports.createLogSilencer = void 0;
43
+ // noExplicitAny: test mock typing
43
44
  // biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
44
45
  var bun_test_1 = require("bun:test");
45
46
  var node_stream_1 = require("node:stream");
@@ -47,6 +48,7 @@ var winston_1 = __importDefault(require("winston"));
47
48
  var getApiWinstonLogger = function () {
48
49
  try {
49
50
  // Runtime-only so @terreno/test compiles without @terreno/api.
51
+ // noExplicitAny: optional peer resolved at preload time
50
52
  // biome-ignore lint/suspicious/noExplicitAny: optional peer resolved at preload time
51
53
  var api = require("@terreno/api");
52
54
  return api.winstonLogger;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerSentryBunMock = void 0;
4
+ // noExplicitAny: test mock typing
4
5
  // biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
5
6
  var bun_test_1 = require("bun:test");
6
7
  /** Registers a global `mock.module("@sentry/bun", ...)` for backend tests. */
@@ -65,6 +66,14 @@ var registerSentryBunMock = function () {
65
66
  requestHandler: (0, bun_test_1.mock)(function () { return function (_req, _res, next) { return next(); }; }),
66
67
  tracingHandler: (0, bun_test_1.mock)(function () { return function (_req, _res, next) { return next(); }; }),
67
68
  };
69
+ var structuredLogger = {
70
+ debug: mockFn(),
71
+ error: mockFn(),
72
+ fatal: mockFn(),
73
+ info: mockFn(),
74
+ trace: mockFn(),
75
+ warn: mockFn(),
76
+ };
68
77
  return {
69
78
  addBreadcrumb: mockFn(),
70
79
  captureException: mockFn(),
@@ -86,6 +95,7 @@ var registerSentryBunMock = function () {
86
95
  Handlers: handlers,
87
96
  init: mockFn(),
88
97
  isInitialized: (0, bun_test_1.mock)(function () { return true; }),
98
+ logger: structuredLogger,
89
99
  popScope: mockFn(),
90
100
  pushScope: mockFn(),
91
101
  Severity: {
@@ -112,6 +122,7 @@ var registerSentryBunMock = function () {
112
122
  Handlers: handlers,
113
123
  init: mockFn(),
114
124
  isInitialized: (0, bun_test_1.mock)(function () { return true; }),
125
+ logger: structuredLogger,
115
126
  popScope: mockFn(),
116
127
  pushScope: mockFn(),
117
128
  Severity: {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // noExplicitAny: Mongoose prototype patches require dynamic signatures
2
3
  // biome-ignore-all lint/suspicious/noExplicitAny: Mongoose prototype patches require dynamic signatures
3
4
  /**
4
5
  * Transaction-based test isolation for MongoDB.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "express": "^5.2.1",
8
- "lodash": "^4.17.23",
8
+ "lodash": "^4.18.1",
9
9
  "qs": "^6.15.0",
10
10
  "winston": "^3.18.3"
11
11
  },
@@ -61,5 +61,5 @@
61
61
  "test:ci": "bun test"
62
62
  },
63
63
  "types": "dist/index.d.ts",
64
- "version": "0.26.0"
64
+ "version": "0.27.0"
65
65
  }
@@ -1,3 +1,4 @@
1
+ // noExplicitAny: test mock typing
1
2
  // biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
2
3
  import {afterEach, beforeEach} from "bun:test";
3
4
  import {Writable} from "node:stream";
@@ -21,6 +22,7 @@ export interface SilenceLogsController {
21
22
  const getApiWinstonLogger = (): winston.Logger | undefined => {
22
23
  try {
23
24
  // Runtime-only so @terreno/test compiles without @terreno/api.
25
+ // noExplicitAny: optional peer resolved at preload time
24
26
  // biome-ignore lint/suspicious/noExplicitAny: optional peer resolved at preload time
25
27
  const api = require("@terreno/api") as any;
26
28
  return api.winstonLogger as winston.Logger | undefined;
@@ -1,3 +1,4 @@
1
+ // noExplicitAny: test mock typing
1
2
  // biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
2
3
  import {mock} from "bun:test";
3
4
 
@@ -70,6 +71,15 @@ export const registerSentryBunMock = (): void => {
70
71
  tracingHandler: mock(() => (_req: any, _res: any, next: any) => next()),
71
72
  };
72
73
 
74
+ const structuredLogger = {
75
+ debug: mockFn(),
76
+ error: mockFn(),
77
+ fatal: mockFn(),
78
+ info: mockFn(),
79
+ trace: mockFn(),
80
+ warn: mockFn(),
81
+ };
82
+
73
83
  return {
74
84
  addBreadcrumb: mockFn(),
75
85
  captureException: mockFn(),
@@ -91,6 +101,7 @@ export const registerSentryBunMock = (): void => {
91
101
  Handlers: handlers,
92
102
  init: mockFn(),
93
103
  isInitialized: mock(() => true),
104
+ logger: structuredLogger,
94
105
  popScope: mockFn(),
95
106
  pushScope: mockFn(),
96
107
  Severity: {
@@ -117,6 +128,7 @@ export const registerSentryBunMock = (): void => {
117
128
  Handlers: handlers,
118
129
  init: mockFn(),
119
130
  isInitialized: mock(() => true),
131
+ logger: structuredLogger,
120
132
  popScope: mockFn(),
121
133
  pushScope: mockFn(),
122
134
  Severity: {
@@ -1,3 +1,4 @@
1
+ // noExplicitAny: Mongoose prototype patches require dynamic signatures
1
2
  // biome-ignore-all lint/suspicious/noExplicitAny: Mongoose prototype patches require dynamic signatures
2
3
  /**
3
4
  * Transaction-based test isolation for MongoDB.