@powerlines/plugin-jest 0.1.661 → 0.1.663

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.
@@ -0,0 +1,19 @@
1
+ import { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig } from "./types/plugin.cjs";
2
+ import "./types/index.cjs";
3
+ import { Plugin } from "powerlines";
4
+ //#region src/index.d.ts
5
+ declare module "powerlines" {
6
+ interface Config {
7
+ jest?: JestPluginOptions;
8
+ }
9
+ }
10
+ /**
11
+ * Jest plugin for Powerlines.
12
+ *
13
+ * @param options - The Jest plugin user configuration options.
14
+ * @returns A Powerlines plugin that integrates Jest testing.
15
+ */
16
+ declare const plugin: <TContext extends JestPluginContext = JestPluginContext>(options?: JestPluginOptions) => Plugin<TContext>;
17
+ //#endregion
18
+ export { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig, plugin as default, plugin };
19
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA6BY;IACR,OAAO;;;;;;;;;cAUE,SAAU,iBAAiB,oBAAoB,mBAC1D,UAAS,sBACR,OAAO"}
@@ -0,0 +1,19 @@
1
+ import { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig } from "./types/plugin.mjs";
2
+ import "./types/index.mjs";
3
+ import { Plugin } from "powerlines";
4
+ //#region src/index.d.ts
5
+ declare module "powerlines" {
6
+ interface Config {
7
+ jest?: JestPluginOptions;
8
+ }
9
+ }
10
+ /**
11
+ * Jest plugin for Powerlines.
12
+ *
13
+ * @param options - The Jest plugin user configuration options.
14
+ * @returns A Powerlines plugin that integrates Jest testing.
15
+ */
16
+ declare const plugin: <TContext extends JestPluginContext = JestPluginContext>(options?: JestPluginOptions) => Plugin<TContext>;
17
+ //#endregion
18
+ export { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig, plugin as default, plugin };
19
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":""}
package/dist/index.mjs CHANGED
@@ -101,4 +101,5 @@ ${chalk.bold(`Time:`)} ${formatTime((Date.now() - results.startTime) / 1e
101
101
  };
102
102
 
103
103
  //#endregion
104
- export { plugin as default, plugin };
104
+ export { plugin as default, plugin };
105
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig } from "./plugin.cjs";
2
+ export { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig };
@@ -0,0 +1,2 @@
1
+ import { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig } from "./plugin.mjs";
2
+ export { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig };
@@ -0,0 +1,213 @@
1
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
2
+ import { Config } from "@jest/types";
3
+ //#region src/types/plugin.d.ts
4
+ interface JestPluginOptions {
5
+ /**
6
+ * Indicates that test coverage information should be collected and reported in the output.
7
+ *
8
+ * @see https://jestjs.io/docs/cli#--coverage
9
+ */
10
+ codeCoverage?: boolean;
11
+ /**
12
+ * The path to a Jest config file specifying how to find and execute tests. If no `rootDir` is set in the config, the directory containing the config file is assumed to be the `rootDir` for the project.
13
+ *
14
+ * @see https://jestjs.io/docs/cli#--configpath
15
+ */
16
+ configFile?: string;
17
+ /**
18
+ * Attempt to collect and print open handles preventing Jest from exiting cleanly after all tests have completed.
19
+ *
20
+ * @see https://jestjs.io/docs/cli#--detectopenhandles
21
+ */
22
+ detectOpenHandles?: boolean;
23
+ /**
24
+ * Logs the heap usage after every test. Useful to debug memory leaks. Use together with --runInBand and --expose-gc in node.
25
+ */
26
+ logHeapUsage?: boolean;
27
+ /**
28
+ * **EXPERIMENTAL**: Detect memory leaks in tests. After executing a test, it will try to garbage collect the global object used, and fail if it was leaked
29
+ */
30
+ detectLeaks?: boolean;
31
+ /**
32
+ * The name of the file to test.
33
+ */
34
+ testFile?: string;
35
+ /**
36
+ * Exit the test suite immediately after `n` number of failing tests.
37
+ *
38
+ * @see https://jestjs.io/docs/cli#--bail
39
+ */
40
+ bail?: boolean | number;
41
+ /**
42
+ * Continuous Integration mode. If true, Jest will run tests once and exit.
43
+ */
44
+ ci?: boolean;
45
+ /**
46
+ * Enables colored output.
47
+ */
48
+ color?: boolean;
49
+ /**
50
+ * Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory.
51
+ */
52
+ clearCache?: boolean;
53
+ /**
54
+ * Find and run the tests that cover a list of source files.
55
+ *
56
+ * @see https://jestjs.io/docs/cli#--findrelatedtests
57
+ */
58
+ findRelatedTests?: string[];
59
+ /**
60
+ * Force Jest to exit after all tests have completed running. This is useful when resources set up by test code cannot be adequately cleaned up.
61
+ */
62
+ forceExit?: boolean;
63
+ /**
64
+ * Enables JSON output.
65
+ */
66
+ json?: boolean;
67
+ /**
68
+ * Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default)
69
+ *
70
+ * @see https://jestjs.io/docs/cli#--maxworkersnumberstring
71
+ */
72
+ maxWorkers?: number | string;
73
+ /**
74
+ * Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a `git` or `hg` repository at the moment.
75
+ *
76
+ * @see https://jestjs.io/docs/cli#--onlychanged
77
+ */
78
+ onlyChanged?: boolean;
79
+ /**
80
+ * Runs tests related to the changes since the provided branch or commit hash. If the current branch has diverged from the given branch, then only changes made locally will be tested.
81
+ *
82
+ * @see https://jestjs.io/docs/cli#--changedsince
83
+ */
84
+ changedSince?: string;
85
+ /**
86
+ * The path to a JSON file that Jest should write test results to.
87
+ */
88
+ outputFile?: string;
89
+ /**
90
+ * Exit with code 0 even if no tests are found.
91
+ *
92
+ * @see https://jestjs.io/docs/cli#--passwithnotests
93
+ *
94
+ * @defaultValue true
95
+ */
96
+ passWithNoTests?: boolean;
97
+ /**
98
+ * Randomize the order of test execution
99
+ */
100
+ randomize?: boolean;
101
+ /**
102
+ * Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI.
103
+ *
104
+ * @see https://jestjs.io/docs/cli#--runinband
105
+ */
106
+ runInBand?: boolean;
107
+ /**
108
+ * Print your Jest config and then exits.
109
+ *
110
+ * @see https://jestjs.io/docs/cli#--showconfig
111
+ */
112
+ showConfig?: boolean;
113
+ /**
114
+ * Prevent tests from printing messages through the console.
115
+ *
116
+ * @see https://jestjs.io/docs/cli#--silent
117
+ */
118
+ silent?: boolean;
119
+ /**
120
+ * Run only tests with a name that matches the regex pattern.
121
+ *
122
+ * @see https://jestjs.io/docs/cli#--testnamepatternregex
123
+ */
124
+ testNamePattern?: string;
125
+ /**
126
+ * An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions.
127
+ *
128
+ * @see https://jestjs.io/docs/cli#--testpathignorepatternsregex
129
+ */
130
+ testPathIgnorePatterns?: string[];
131
+ /**
132
+ * An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run tests with a path that matches the provided regexp expressions.
133
+ *
134
+ * @see https://jestjs.io/docs/cli#--testpathpatternsregex
135
+ */
136
+ testPathPatterns?: string[];
137
+ /**
138
+ * Enables colored output.
139
+ */
140
+ colors?: boolean;
141
+ /**
142
+ * A list of reporters to use for test results
143
+ */
144
+ reporters?: string[];
145
+ /**
146
+ * Display individual test results with the test suite hierarchy.
147
+ *
148
+ * @see https://jestjs.io/docs/cli#--verbose
149
+ */
150
+ verbose?: boolean;
151
+ /**
152
+ * A list of coverage reporters to use
153
+ */
154
+ coverageReporters?: string[];
155
+ /**
156
+ * The directory where Jest should output its coverage files.
157
+ */
158
+ coverageDirectory?: string;
159
+ /**
160
+ * A Node module that implements a custom results processor.
161
+ */
162
+ testResultsProcessor?: string;
163
+ /**
164
+ * Update snapshots during this test run.
165
+ */
166
+ updateSnapshot?: boolean;
167
+ /**
168
+ * Divert all output to stderr.
169
+ */
170
+ useStderr?: boolean;
171
+ /**
172
+ * Watch files for changes and rerun tests related to changed files.
173
+ */
174
+ watch?: boolean;
175
+ /**
176
+ * Watch files for changes and rerun all tests when something changes.
177
+ */
178
+ watchAll?: boolean;
179
+ /**
180
+ * Adds a location field to test results. Used to report location of a test in a reporter. Example: `{ "column": 4, "line": 5 }`.
181
+ *
182
+ * @see https://jestjs.io/docs/cli#--testlocationinresultsboolean
183
+ */
184
+ testLocationInResults?: boolean;
185
+ /**
186
+ * Default timeout of a test in milliseconds.
187
+ *
188
+ * @see https://jestjs.io/docs/cli#--testtimeoutmilliseconds
189
+ *
190
+ * @defaultValue 5000
191
+ */
192
+ testTimeout?: number;
193
+ }
194
+ interface JestPluginUserConfig extends UserConfig {
195
+ test: {
196
+ /**
197
+ * Jest transformation options
198
+ */
199
+ jest: Config.Argv;
200
+ };
201
+ }
202
+ interface JestPluginResolvedConfig extends ResolvedConfig {
203
+ test: {
204
+ /**
205
+ * Resolved Jest transformation options
206
+ */
207
+ jest: Config.Argv;
208
+ };
209
+ }
210
+ type JestPluginContext<TResolvedConfig extends JestPluginResolvedConfig = JestPluginResolvedConfig> = PluginContext<TResolvedConfig>;
211
+ //#endregion
212
+ export { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig };
213
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;UAqBiB;;;;;;EAMf;;;;;;EAOA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;EAKA;;;;;;;;EASA;;;;EAKA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;EAOA;;;;;;;;EASA;;UAGe,6BAA6B;EAC5C;;;;IAIE,MAAM,OAAO;;;UAIA,iCAAiC;EAChD;;;;IAIE,MAAM,OAAO;;;KAIL,kBACV,wBAAwB,2BAA2B,4BACjD,cAAc"}
@@ -0,0 +1,213 @@
1
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
2
+ import { Config } from "@jest/types";
3
+ //#region src/types/plugin.d.ts
4
+ interface JestPluginOptions {
5
+ /**
6
+ * Indicates that test coverage information should be collected and reported in the output.
7
+ *
8
+ * @see https://jestjs.io/docs/cli#--coverage
9
+ */
10
+ codeCoverage?: boolean;
11
+ /**
12
+ * The path to a Jest config file specifying how to find and execute tests. If no `rootDir` is set in the config, the directory containing the config file is assumed to be the `rootDir` for the project.
13
+ *
14
+ * @see https://jestjs.io/docs/cli#--configpath
15
+ */
16
+ configFile?: string;
17
+ /**
18
+ * Attempt to collect and print open handles preventing Jest from exiting cleanly after all tests have completed.
19
+ *
20
+ * @see https://jestjs.io/docs/cli#--detectopenhandles
21
+ */
22
+ detectOpenHandles?: boolean;
23
+ /**
24
+ * Logs the heap usage after every test. Useful to debug memory leaks. Use together with --runInBand and --expose-gc in node.
25
+ */
26
+ logHeapUsage?: boolean;
27
+ /**
28
+ * **EXPERIMENTAL**: Detect memory leaks in tests. After executing a test, it will try to garbage collect the global object used, and fail if it was leaked
29
+ */
30
+ detectLeaks?: boolean;
31
+ /**
32
+ * The name of the file to test.
33
+ */
34
+ testFile?: string;
35
+ /**
36
+ * Exit the test suite immediately after `n` number of failing tests.
37
+ *
38
+ * @see https://jestjs.io/docs/cli#--bail
39
+ */
40
+ bail?: boolean | number;
41
+ /**
42
+ * Continuous Integration mode. If true, Jest will run tests once and exit.
43
+ */
44
+ ci?: boolean;
45
+ /**
46
+ * Enables colored output.
47
+ */
48
+ color?: boolean;
49
+ /**
50
+ * Deletes the Jest cache directory and then exits without running tests. Will delete Jest's default cache directory.
51
+ */
52
+ clearCache?: boolean;
53
+ /**
54
+ * Find and run the tests that cover a list of source files.
55
+ *
56
+ * @see https://jestjs.io/docs/cli#--findrelatedtests
57
+ */
58
+ findRelatedTests?: string[];
59
+ /**
60
+ * Force Jest to exit after all tests have completed running. This is useful when resources set up by test code cannot be adequately cleaned up.
61
+ */
62
+ forceExit?: boolean;
63
+ /**
64
+ * Enables JSON output.
65
+ */
66
+ json?: boolean;
67
+ /**
68
+ * Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. Useful for CI. (its usually best not to override this default)
69
+ *
70
+ * @see https://jestjs.io/docs/cli#--maxworkersnumberstring
71
+ */
72
+ maxWorkers?: number | string;
73
+ /**
74
+ * Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a `git` or `hg` repository at the moment.
75
+ *
76
+ * @see https://jestjs.io/docs/cli#--onlychanged
77
+ */
78
+ onlyChanged?: boolean;
79
+ /**
80
+ * Runs tests related to the changes since the provided branch or commit hash. If the current branch has diverged from the given branch, then only changes made locally will be tested.
81
+ *
82
+ * @see https://jestjs.io/docs/cli#--changedsince
83
+ */
84
+ changedSince?: string;
85
+ /**
86
+ * The path to a JSON file that Jest should write test results to.
87
+ */
88
+ outputFile?: string;
89
+ /**
90
+ * Exit with code 0 even if no tests are found.
91
+ *
92
+ * @see https://jestjs.io/docs/cli#--passwithnotests
93
+ *
94
+ * @defaultValue true
95
+ */
96
+ passWithNoTests?: boolean;
97
+ /**
98
+ * Randomize the order of test execution
99
+ */
100
+ randomize?: boolean;
101
+ /**
102
+ * Run all tests serially in the current process (rather than creating a worker pool of child processes that run tests). This is sometimes useful for debugging, but such use cases are pretty rare. Useful for CI.
103
+ *
104
+ * @see https://jestjs.io/docs/cli#--runinband
105
+ */
106
+ runInBand?: boolean;
107
+ /**
108
+ * Print your Jest config and then exits.
109
+ *
110
+ * @see https://jestjs.io/docs/cli#--showconfig
111
+ */
112
+ showConfig?: boolean;
113
+ /**
114
+ * Prevent tests from printing messages through the console.
115
+ *
116
+ * @see https://jestjs.io/docs/cli#--silent
117
+ */
118
+ silent?: boolean;
119
+ /**
120
+ * Run only tests with a name that matches the regex pattern.
121
+ *
122
+ * @see https://jestjs.io/docs/cli#--testnamepatternregex
123
+ */
124
+ testNamePattern?: string;
125
+ /**
126
+ * An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run those tests with a path that does not match with the provided regexp expressions.
127
+ *
128
+ * @see https://jestjs.io/docs/cli#--testpathignorepatternsregex
129
+ */
130
+ testPathIgnorePatterns?: string[];
131
+ /**
132
+ * An array of regexp pattern strings that is matched against all tests paths before executing the test. Only run tests with a path that matches the provided regexp expressions.
133
+ *
134
+ * @see https://jestjs.io/docs/cli#--testpathpatternsregex
135
+ */
136
+ testPathPatterns?: string[];
137
+ /**
138
+ * Enables colored output.
139
+ */
140
+ colors?: boolean;
141
+ /**
142
+ * A list of reporters to use for test results
143
+ */
144
+ reporters?: string[];
145
+ /**
146
+ * Display individual test results with the test suite hierarchy.
147
+ *
148
+ * @see https://jestjs.io/docs/cli#--verbose
149
+ */
150
+ verbose?: boolean;
151
+ /**
152
+ * A list of coverage reporters to use
153
+ */
154
+ coverageReporters?: string[];
155
+ /**
156
+ * The directory where Jest should output its coverage files.
157
+ */
158
+ coverageDirectory?: string;
159
+ /**
160
+ * A Node module that implements a custom results processor.
161
+ */
162
+ testResultsProcessor?: string;
163
+ /**
164
+ * Update snapshots during this test run.
165
+ */
166
+ updateSnapshot?: boolean;
167
+ /**
168
+ * Divert all output to stderr.
169
+ */
170
+ useStderr?: boolean;
171
+ /**
172
+ * Watch files for changes and rerun tests related to changed files.
173
+ */
174
+ watch?: boolean;
175
+ /**
176
+ * Watch files for changes and rerun all tests when something changes.
177
+ */
178
+ watchAll?: boolean;
179
+ /**
180
+ * Adds a location field to test results. Used to report location of a test in a reporter. Example: `{ "column": 4, "line": 5 }`.
181
+ *
182
+ * @see https://jestjs.io/docs/cli#--testlocationinresultsboolean
183
+ */
184
+ testLocationInResults?: boolean;
185
+ /**
186
+ * Default timeout of a test in milliseconds.
187
+ *
188
+ * @see https://jestjs.io/docs/cli#--testtimeoutmilliseconds
189
+ *
190
+ * @defaultValue 5000
191
+ */
192
+ testTimeout?: number;
193
+ }
194
+ interface JestPluginUserConfig extends UserConfig {
195
+ test: {
196
+ /**
197
+ * Jest transformation options
198
+ */
199
+ jest: Config.Argv;
200
+ };
201
+ }
202
+ interface JestPluginResolvedConfig extends ResolvedConfig {
203
+ test: {
204
+ /**
205
+ * Resolved Jest transformation options
206
+ */
207
+ jest: Config.Argv;
208
+ };
209
+ }
210
+ type JestPluginContext<TResolvedConfig extends JestPluginResolvedConfig = JestPluginResolvedConfig> = PluginContext<TResolvedConfig>;
211
+ //#endregion
212
+ export { JestPluginContext, JestPluginOptions, JestPluginResolvedConfig, JestPluginUserConfig };
213
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-jest",
3
- "version": "0.1.661",
3
+ "version": "0.1.663",
4
4
  "type": "module",
5
5
  "description": "A package containing the Jest testing plugin for Powerlines.",
6
6
  "repository": {
@@ -95,21 +95,21 @@
95
95
  "@jest/test-result": "^30.4.1",
96
96
  "@jest/types": "^30.4.1",
97
97
  "@sinclair/typebox": "^0.34.52",
98
- "@stryke/fs": "^0.33.103",
99
- "@stryke/path": "^0.29.29",
98
+ "@stryke/fs": "^0.33.109",
99
+ "@stryke/path": "^0.29.34",
100
100
  "chalk": "5.6.2",
101
101
  "defu": "^6.1.7",
102
102
  "jest": "^30.4.2",
103
103
  "jest-config": "^30.4.2",
104
104
  "jest-resolve": "^30.4.1",
105
105
  "jest-util": "^30.4.1",
106
- "powerlines": "^0.47.192"
106
+ "powerlines": "0.47.194"
107
107
  },
108
108
  "devDependencies": {
109
- "@powerlines/plugin-plugin": "^0.12.604",
109
+ "@powerlines/plugin-plugin": "0.12.606",
110
110
  "@types/jest": "^30.0.0"
111
111
  },
112
112
  "publishConfig": { "access": "public" },
113
113
  "types": "./dist/index.d.cts",
114
- "gitHead": "62e23a61fe63b8799f1fa53f97d463ca1b39a64c"
114
+ "gitHead": "ca37aa95827eddaaa3b5c8cb750249cc9045ac29"
115
115
  }