@prisma/get-platform 6.9.0-dev.5 → 6.9.0-dev.51

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.
@@ -26,13 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_4CHMSIXA_exports = {};
30
- __export(chunk_4CHMSIXA_exports, {
29
+ var chunk_HE3NEP2U_exports = {};
30
+ __export(chunk_HE3NEP2U_exports, {
31
31
  jestConsoleContext: () => jestConsoleContext,
32
32
  jestContext: () => jestContext,
33
- jestProcessContext: () => jestProcessContext
33
+ jestStdoutContext: () => jestStdoutContext,
34
+ processExitContext: () => processExitContext
34
35
  });
35
- module.exports = __toCommonJS(chunk_4CHMSIXA_exports);
36
+ module.exports = __toCommonJS(chunk_HE3NEP2U_exports);
36
37
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
37
38
  var import_path = __toESM(require("path"));
38
39
  var require_windows = (0, import_chunk_2ESYSVXG.__commonJS)({
@@ -14957,11 +14958,21 @@ var jestConsoleContext = () => (c) => {
14957
14958
  });
14958
14959
  return ctx;
14959
14960
  };
14960
- var jestProcessContext = () => (c) => {
14961
+ var jestStdoutContext = ({ normalizationRules } = { normalizationRules: [] }) => (c) => {
14961
14962
  const ctx = c;
14963
+ const normalize = (text, rules) => {
14964
+ for (const [pattern, replacement] of rules) {
14965
+ text = text.replace(pattern, replacement);
14966
+ }
14967
+ return text;
14968
+ };
14962
14969
  beforeEach(() => {
14963
14970
  ctx.mocked["process.stderr.write"] = jest.spyOn(process.stderr, "write").mockImplementation(() => true);
14964
14971
  ctx.mocked["process.stdout.write"] = jest.spyOn(process.stdout, "write").mockImplementation(() => true);
14972
+ ctx.normalizedCapturedStdout = () => normalize(ctx.mocked["process.stdout.write"].mock.calls.join(""), normalizationRules);
14973
+ ctx.normalizedCapturedStderr = () => normalize(ctx.mocked["process.stderr.write"].mock.calls.join(""), normalizationRules);
14974
+ ctx.clearCapturedStdout = () => ctx.mocked["process.stdout.write"].mockClear();
14975
+ ctx.clearCapturedStderr = () => ctx.mocked["process.stderr.write"].mockClear();
14965
14976
  });
14966
14977
  afterEach(() => {
14967
14978
  ctx.mocked["process.stderr.write"].mockRestore();
@@ -14969,6 +14980,19 @@ var jestProcessContext = () => (c) => {
14969
14980
  });
14970
14981
  return ctx;
14971
14982
  };
14983
+ var processExitContext = () => (c) => {
14984
+ const ctx = c;
14985
+ beforeEach(() => {
14986
+ ctx.mocked["process.exit"] = jest.spyOn(process, "exit").mockImplementation((number) => {
14987
+ throw new Error("process.exit: " + number);
14988
+ });
14989
+ ctx.recordedExitCode = () => ctx.mocked["process.exit"].mock.calls[0]?.[0];
14990
+ });
14991
+ afterEach(() => {
14992
+ ctx.mocked["process.exit"].mockRestore();
14993
+ });
14994
+ return ctx;
14995
+ };
14972
14996
  /*! Bundled license information:
14973
14997
 
14974
14998
  is-extglob/index.js:
package/dist/index.js CHANGED
@@ -24,14 +24,15 @@ __export(index_exports, {
24
24
  getNodeAPIName: () => import_chunk_2U36ISZO.getNodeAPIName,
25
25
  getPlatformInfo: () => import_chunk_7PMGXL6S.getPlatformInfo,
26
26
  getos: () => import_chunk_7PMGXL6S.getos,
27
- jestConsoleContext: () => import_chunk_4CHMSIXA.jestConsoleContext,
28
- jestContext: () => import_chunk_4CHMSIXA.jestContext,
29
- jestProcessContext: () => import_chunk_4CHMSIXA.jestProcessContext,
30
- link: () => import_chunk_M5T7GI2R.link
27
+ jestConsoleContext: () => import_chunk_HE3NEP2U.jestConsoleContext,
28
+ jestContext: () => import_chunk_HE3NEP2U.jestContext,
29
+ jestStdoutContext: () => import_chunk_HE3NEP2U.jestStdoutContext,
30
+ link: () => import_chunk_M5T7GI2R.link,
31
+ processExitContext: () => import_chunk_HE3NEP2U.processExitContext
31
32
  });
32
33
  module.exports = __toCommonJS(index_exports);
33
34
  var import_chunk_6HZWON4S = require("./chunk-6HZWON4S.js");
34
- var import_chunk_4CHMSIXA = require("./chunk-4CHMSIXA.js");
35
+ var import_chunk_HE3NEP2U = require("./chunk-HE3NEP2U.js");
35
36
  var import_chunk_O5EOXX3N = require("./chunk-O5EOXX3N.js");
36
37
  var import_chunk_2U36ISZO = require("./chunk-2U36ISZO.js");
37
38
  var import_chunk_7PMGXL6S = require("./chunk-7PMGXL6S.js");
@@ -1 +1 @@
1
- export { type BaseContext, jestConsoleContext, jestContext, jestProcessContext } from './jestContext';
1
+ export { type BaseContext, jestConsoleContext, jestContext, jestStdoutContext, type ProcessContextSettings, processExitContext, } from './jestContext';
@@ -18,11 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var test_utils_exports = {};
20
20
  __export(test_utils_exports, {
21
- jestConsoleContext: () => import_chunk_4CHMSIXA.jestConsoleContext,
22
- jestContext: () => import_chunk_4CHMSIXA.jestContext,
23
- jestProcessContext: () => import_chunk_4CHMSIXA.jestProcessContext
21
+ jestConsoleContext: () => import_chunk_HE3NEP2U.jestConsoleContext,
22
+ jestContext: () => import_chunk_HE3NEP2U.jestContext,
23
+ jestStdoutContext: () => import_chunk_HE3NEP2U.jestStdoutContext,
24
+ processExitContext: () => import_chunk_HE3NEP2U.processExitContext
24
25
  });
25
26
  module.exports = __toCommonJS(test_utils_exports);
26
27
  var import_chunk_6HZWON4S = require("../chunk-6HZWON4S.js");
27
- var import_chunk_4CHMSIXA = require("../chunk-4CHMSIXA.js");
28
+ var import_chunk_HE3NEP2U = require("../chunk-HE3NEP2U.js");
28
29
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
@@ -75,10 +75,6 @@ export declare const jestContext: {
75
75
  assemble(): BaseContext;
76
76
  };
77
77
  };
78
- /**
79
- * Factory for creating a context contributor possibly configured in some special way.
80
- */
81
- type ContextContributorFactory<Settings, Context, NewContext> = Settings extends {} ? () => ContextContributor<Context, NewContext> : (settings: Settings) => ContextContributor<Context, NewContext>;
82
78
  /**
83
79
  * A function that provides additional test context.
84
80
  */
@@ -94,7 +90,7 @@ type ConsoleContext = {
94
90
  'console.warn': jest.SpyInstance;
95
91
  };
96
92
  };
97
- export declare const jestConsoleContext: ContextContributorFactory<{}, BaseContext, ConsoleContext>;
93
+ export declare const jestConsoleContext: <Ctx extends BaseContext>() => (c: Ctx) => Ctx & ConsoleContext;
98
94
  /**
99
95
  * Test context contributor. Mocks process.std(out|err).write with a Jest spy before each test.
100
96
  */
@@ -103,6 +99,24 @@ type ProcessContext = {
103
99
  'process.stderr.write': jest.SpyInstance;
104
100
  'process.stdout.write': jest.SpyInstance;
105
101
  };
102
+ normalizedCapturedStdout: () => string;
103
+ normalizedCapturedStderr: () => string;
104
+ clearCapturedStdout: () => void;
105
+ clearCapturedStderr: () => void;
106
+ };
107
+ type NormalizationRule = [RegExp | string, string];
108
+ export type ProcessContextSettings = {
109
+ normalizationRules: NormalizationRule[];
110
+ };
111
+ export declare const jestStdoutContext: <Ctx extends BaseContext>({ normalizationRules }?: ProcessContextSettings) => (c: Ctx) => Ctx & ProcessContext;
112
+ /**
113
+ * Test context contributor. Mocks process.exit with a spay and records the exit code.
114
+ */
115
+ type ProcessExitContext = {
116
+ mocked: {
117
+ 'process.exit': jest.SpyInstance;
118
+ };
119
+ recordedExitCode: () => number;
106
120
  };
107
- export declare const jestProcessContext: ContextContributorFactory<{}, BaseContext, ProcessContext>;
121
+ export declare const processExitContext: <C extends BaseContext>() => (c: C) => C & ProcessExitContext;
108
122
  export {};
@@ -18,10 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var jestContext_exports = {};
20
20
  __export(jestContext_exports, {
21
- jestConsoleContext: () => import_chunk_4CHMSIXA.jestConsoleContext,
22
- jestContext: () => import_chunk_4CHMSIXA.jestContext,
23
- jestProcessContext: () => import_chunk_4CHMSIXA.jestProcessContext
21
+ jestConsoleContext: () => import_chunk_HE3NEP2U.jestConsoleContext,
22
+ jestContext: () => import_chunk_HE3NEP2U.jestContext,
23
+ jestStdoutContext: () => import_chunk_HE3NEP2U.jestStdoutContext,
24
+ processExitContext: () => import_chunk_HE3NEP2U.processExitContext
24
25
  });
25
26
  module.exports = __toCommonJS(jestContext_exports);
26
- var import_chunk_4CHMSIXA = require("../chunk-4CHMSIXA.js");
27
+ var import_chunk_HE3NEP2U = require("../chunk-HE3NEP2U.js");
27
28
  var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/get-platform",
3
- "version": "6.9.0-dev.5",
3
+ "version": "6.9.0-dev.51",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "ts-pattern": "5.6.2"
34
34
  },
35
35
  "dependencies": {
36
- "@prisma/debug": "6.9.0-dev.5"
36
+ "@prisma/debug": "6.9.0-dev.51"
37
37
  },
38
38
  "files": [
39
39
  "README.md",