@gatling.io/core 3.11.2 → 3.11.3

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.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Gatling JS - Core module
2
+
3
+ Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
4
+
5
+ This package contains the [Gatling JS core DSL](https://docs.gatling.io/reference/script/core/).
6
+
7
+ To get started with Gatling JS, see our [introduction to JavaScript scripting](https://docs.gatling.io/tutorials/scripting-intro-js); or simply have a look at [our demo projects](https://github.com/gatling/gatling-js-demo).
8
+
9
+ ## Questions, help?
10
+
11
+ Read the [documentation](https://docs.gatling.io).
12
+
13
+ Join the [Gatling Community Forum](https://community.gatling.io).
14
+
15
+ Found a real bug? Raise an [issue](https://github.com/gatling/gatling/issues).
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@gatling.io/core",
3
- "version": "3.11.2",
3
+ "version": "3.11.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "target/index.js",
6
6
  "types": "target/index.d.ts",
7
7
  "dependencies": {
8
- "@gatling.io/jvm-types": "3.11.2"
8
+ "@gatling.io/jvm-types": "3.11.3"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@types/jest": "29.5.12",
package/target/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import "@gatling.io/jvm-types";
2
+ import * as jvm from "./gatlingJvm/app";
2
3
  import { PauseType } from "./structure/pauses";
3
4
  import { Duration } from "./utils/duration";
4
5
  import { SessionTo } from "./session";
@@ -112,19 +113,4 @@ export interface SetUp {
112
113
  }
113
114
  export type SetUpFunction = (...populationBuilders: PopulationBuilder[]) => SetUp;
114
115
  export type Simulation = (setUp: SetUpFunction) => void;
115
- export interface SimulationFunction {
116
- /**
117
- * Register a Gatling simulation, with the default name (which is "default")
118
- *
119
- * @param simulationSetUp - The function setting up the simulation
120
- */
121
- (simulationSetUp: Simulation): void;
122
- /**
123
- * Register a Gatling simulation
124
- *
125
- * @param simulationName - The simulation name (max 100 characters)
126
- * @param simulationSetUp - The function setting up the simulation
127
- */
128
- (simulationName: string, simulationSetUp: Simulation): void;
129
- }
130
- export declare const simulation: SimulationFunction;
116
+ export declare const simulation: (simulation: Simulation) => jvm.Simulation;
package/target/index.js CHANGED
@@ -51,18 +51,7 @@ const wrapSetUp = (jvmSetUp) => ({
51
51
  normalPausesWithPercentageDuration: (stdDevPercent) => wrapSetUp(jvmSetUp.normalPausesWithPercentageDuration(stdDevPercent)),
52
52
  pauses: (pauseType) => wrapSetUp(jvmSetUp.pauses((0, pauses_1.toJvmPauseType)(pauseType)))
53
53
  });
54
- const simulation = (arg0, arg1) => {
55
- const [simulationName, simulationSetUp] = arg1 !== undefined ? [arg0.trim(), arg1] : ["default", arg0];
56
- if (simulationName.length === 0) {
57
- throw Error("simulationName must not be empty");
58
- }
59
- if ([...simulationName].length > 100) {
60
- // Count actual characters, not UTF-16 code units as with simulationName.length
61
- throw Error("simulationName must not exceed 100 characters");
62
- }
63
- const JsSimulation = Java.type("io.gatling.js.JsSimulation");
64
- JsSimulation.registerJsSimulation(simulationName, (jvmSetUp) => {
65
- simulationSetUp((...populationBuilders) => wrapSetUp(jvmSetUp(populationBuilders.map((p) => p._underlying))));
66
- });
54
+ const simulation = (simulation) => (jvmSetUp) => {
55
+ simulation((...populationBuilders) => wrapSetUp(jvmSetUp(populationBuilders.map((p) => p._underlying))));
67
56
  };
68
57
  exports.simulation = simulation;