@minecraft/server-gametest 1.0.0-beta.1.20.70-preview.22 → 1.0.0-beta.1.20.70-preview.25

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.
Files changed (2) hide show
  1. package/index.d.ts +93 -64
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  * ```json
18
18
  * {
19
19
  * "module_name": "@minecraft/server-gametest",
20
- * "version": "1.0.0-internal.1.20.70-preview.22"
20
+ * "version": "1.0.0-internal.1.20.70-preview.25"
21
21
  * }
22
22
  * ```
23
23
  *
@@ -1179,22 +1179,24 @@ export class Test {
1179
1179
  * {@link GameTestError}
1180
1180
  * @example simpleMobTest.ts
1181
1181
  * ```typescript
1182
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1183
- * const attackerId = "fox";
1184
- * const victimId = "chicken";
1182
+ * import * as gameTest from '@minecraft/server-gametest';
1185
1183
  *
1186
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1187
- * let victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
1184
+ * gameTest
1185
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
1186
+ * const attackerId = 'fox';
1187
+ * const victimId = 'chicken';
1188
1188
  *
1189
- * test.assertEntityInstancePresentInArea(victim, true);
1189
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1190
+ * const victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
1190
1191
  *
1191
- * test.succeedWhen(() => {
1192
- * test.assertEntityInstancePresentInArea(victim, false);
1193
- * });
1194
- * })
1195
- * .maxTicks(400)
1196
- * .structureName("gametests:mediumglass");
1192
+ * test.assertEntityInstancePresentInArea(victim, true);
1197
1193
  *
1194
+ * test.succeedWhen(() => {
1195
+ * test.assertEntityInstancePresentInArea(victim, false);
1196
+ * });
1197
+ * })
1198
+ * .maxTicks(400)
1199
+ * .structureName('gametests:mediumglass');
1198
1200
  * ```
1199
1201
  */
1200
1202
  assertEntityInstancePresentInArea(entity: minecraftserver.Entity, isPresent?: boolean): void;
@@ -1246,21 +1248,24 @@ export class Test {
1246
1248
  * {@link GameTestError}
1247
1249
  * @example simpleMobTest.ts
1248
1250
  * ```typescript
1249
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1250
- * const attackerId = "fox";
1251
- * const victimId = "chicken";
1251
+ * import * as gameTest from '@minecraft/server-gametest';
1252
+ *
1253
+ * gameTest
1254
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
1255
+ * const attackerId = 'fox';
1256
+ * const victimId = 'chicken';
1252
1257
  *
1253
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1254
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1258
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1259
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1255
1260
  *
1256
- * test.assertEntityPresentInArea(victimId, true);
1261
+ * test.assertEntityPresentInArea(victimId, true);
1257
1262
  *
1258
- * test.succeedWhen(() => {
1259
- * test.assertEntityPresentInArea(victimId, false);
1260
- * });
1261
- * })
1263
+ * test.succeedWhen(() => {
1264
+ * test.assertEntityPresentInArea(victimId, false);
1265
+ * });
1266
+ * })
1262
1267
  * .maxTicks(400)
1263
- * .structureName("gametests:mediumglass");
1268
+ * .structureName('gametests:mediumglass');
1264
1269
  * ```
1265
1270
  */
1266
1271
  assertEntityPresentInArea(entityTypeIdentifier: string, isPresent?: boolean): void;
@@ -1782,21 +1787,24 @@ export class Test {
1782
1787
  * {@link minecraftserver.GameTestError}
1783
1788
  * @example simpleMobTest.ts
1784
1789
  * ```typescript
1785
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1786
- * const attackerId = "fox";
1787
- * const victimId = "chicken";
1790
+ * import * as gameTest from '@minecraft/server-gametest';
1788
1791
  *
1789
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1790
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1792
+ * gameTest
1793
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
1794
+ * const attackerId = 'fox';
1795
+ * const victimId = 'chicken';
1791
1796
  *
1792
- * test.assertEntityPresentInArea(victimId, true);
1797
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1798
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1793
1799
  *
1794
- * test.succeedWhen(() => {
1795
- * test.assertEntityPresentInArea(victimId, false);
1796
- * });
1797
- * })
1800
+ * test.assertEntityPresentInArea(victimId, true);
1801
+ *
1802
+ * test.succeedWhen(() => {
1803
+ * test.assertEntityPresentInArea(victimId, false);
1804
+ * });
1805
+ * })
1798
1806
  * .maxTicks(400)
1799
- * .structureName("gametests:mediumglass");
1807
+ * .structureName('gametests:mediumglass');
1800
1808
  * ```
1801
1809
  * @example spawnAdultPig.js
1802
1810
  * ```typescript
@@ -2009,21 +2017,24 @@ export class Test {
2009
2017
  * @throws This function can throw errors.
2010
2018
  * @example simpleMobTest.ts
2011
2019
  * ```typescript
2012
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
2013
- * const attackerId = "fox";
2014
- * const victimId = "chicken";
2020
+ * import * as gameTest from '@minecraft/server-gametest';
2021
+ *
2022
+ * gameTest
2023
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
2024
+ * const attackerId = 'fox';
2025
+ * const victimId = 'chicken';
2015
2026
  *
2016
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2017
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2027
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2028
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2018
2029
  *
2019
- * test.assertEntityPresentInArea(victimId, true);
2030
+ * test.assertEntityPresentInArea(victimId, true);
2020
2031
  *
2021
- * test.succeedWhen(() => {
2022
- * test.assertEntityPresentInArea(victimId, false);
2023
- * });
2024
- * })
2032
+ * test.succeedWhen(() => {
2033
+ * test.assertEntityPresentInArea(victimId, false);
2034
+ * });
2035
+ * })
2025
2036
  * .maxTicks(400)
2026
- * .structureName("gametests:mediumglass");
2037
+ * .structureName('gametests:mediumglass');
2027
2038
  * ```
2028
2039
  */
2029
2040
  succeedWhen(callback: () => void): void;
@@ -2248,29 +2259,26 @@ export class GameTestError extends Error {
2248
2259
  * Returns a {@link RegistrationBuilder} object where
2249
2260
  * additional options for this test can be specified via
2250
2261
  * builder methods.
2251
- * @example example1.js
2252
- * ```typescript
2253
- * GameTest.register("ExampleTests", "alwaysFail", (test) => {
2254
- * test.fail("This test, runnable via '/gametest run ExampleTests:alwaysFail', will always fail");
2255
- * });
2256
- * ```
2257
2262
  * @example simpleMobTest.ts
2258
2263
  * ```typescript
2259
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
2260
- * const attackerId = "fox";
2261
- * const victimId = "chicken";
2264
+ * import * as gameTest from '@minecraft/server-gametest';
2265
+ *
2266
+ * gameTest
2267
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
2268
+ * const attackerId = 'fox';
2269
+ * const victimId = 'chicken';
2262
2270
  *
2263
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2264
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2271
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2272
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2265
2273
  *
2266
- * test.assertEntityPresentInArea(victimId, true);
2274
+ * test.assertEntityPresentInArea(victimId, true);
2267
2275
  *
2268
- * test.succeedWhen(() => {
2269
- * test.assertEntityPresentInArea(victimId, false);
2270
- * });
2271
- * })
2272
- * .maxTicks(400)
2273
- * .structureName("gametests:mediumglass");
2276
+ * test.succeedWhen(() => {
2277
+ * test.assertEntityPresentInArea(victimId, false);
2278
+ * });
2279
+ * })
2280
+ * .maxTicks(400)
2281
+ * .structureName('gametests:mediumglass');
2274
2282
  * ```
2275
2283
  */
2276
2284
  export function register(
@@ -2296,6 +2304,27 @@ export function register(
2296
2304
  * Returns a {@link RegistrationBuilder} object where
2297
2305
  * additional options for this test can be specified via
2298
2306
  * builder methods.
2307
+ * @example simpleMobAsyncTest.ts
2308
+ * ```typescript
2309
+ * import * as gameTest from '@minecraft/server-gametest';
2310
+ *
2311
+ * gameTest
2312
+ * .registerAsync('StarterTests', 'simpleMobTest', async (test: gameTest.Test) => {
2313
+ * const attackerId = 'fox';
2314
+ * const victimId = 'chicken';
2315
+ *
2316
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2317
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2318
+ *
2319
+ * test.assertEntityPresentInArea(victimId, true);
2320
+ *
2321
+ * test.succeedWhen(() => {
2322
+ * test.assertEntityPresentInArea(victimId, false);
2323
+ * });
2324
+ * })
2325
+ * .maxTicks(400)
2326
+ * .structureName('gametests:mediumglass');
2327
+ * ```
2299
2328
  */
2300
2329
  export function registerAsync(
2301
2330
  testClassName: string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-gametest",
3
- "version": "1.0.0-beta.1.20.70-preview.22",
3
+ "version": "1.0.0-beta.1.20.70-preview.25",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {