factorio-test 1.1.1 → 3.0.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.
Files changed (2) hide show
  1. package/index.d.ts +30 -13
  2. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -18,23 +18,20 @@ declare function tags(...tags: string[]): void
18
18
  /** @noSelf */
19
19
  declare namespace FactorioTest {
20
20
  interface Config {
21
+ test_pattern?: string
22
+ tag_whitelist?: string[]
23
+ tag_blacklist?: string[]
21
24
  default_timeout: number
22
- default_ticks_between_tests: number
23
-
24
25
  game_speed: number
25
-
26
26
  log_passed_tests: boolean
27
27
  log_skipped_tests: boolean
28
+ reorder_failed_first: boolean
29
+ bail?: number
28
30
 
29
- test_pattern?: string
30
- tag_whitelist?: string[]
31
- tag_blacklist?: string[]
32
-
31
+ default_ticks_between_tests: number
33
32
  before_test_run?(): void
34
33
  after_test_run?(): void
35
-
36
34
  sound_effects: boolean
37
-
38
35
  load_luassert: boolean
39
36
  }
40
37
 
@@ -50,6 +47,15 @@ declare namespace FactorioTest {
50
47
  interface TestCreatorBase {
51
48
  (name: string, func: TestFn): TestBuilder
52
49
 
50
+ /**
51
+ * Template syntax for name parameter:
52
+ * - `$property` - Access object property (when value is an object)
53
+ * - `$foo.bar` - Nested property access
54
+ * - `%#` - 0-based test index
55
+ * - `%$` - 1-based test index
56
+ * - `%p` - Pretty-format value
57
+ * - `%d`, `%s`, etc. - Lua format specifiers
58
+ */
53
59
  each<const V extends readonly any[]>(
54
60
  values: readonly V[],
55
61
  ): (name: string, func: (...values: MutableValues<V>) => void) => TestBuilder<typeof func>
@@ -64,16 +70,27 @@ declare namespace FactorioTest {
64
70
  }
65
71
 
66
72
  /** @noSelf */
67
- export interface TestBuilder<F extends (...args: any) => void = TestFn> {
68
- after_script_reload(func: F): TestBuilder<F>
69
- after_mod_reload(func: F): TestBuilder<F>
73
+ export interface TestBuilder<F extends (this: void, ...args: any) => void = TestFn> {
74
+ after_reload_script(func: F): TestBuilder<F>
75
+ after_reload_mods(func: F): TestBuilder<F>
70
76
  }
71
77
 
72
78
  /** @noSelf */
73
79
  interface DescribeBlockCreatorBase {
74
80
  (name: string, func: TestFn): void
75
81
 
76
- each<const V extends readonly any[]>(values: readonly V[]): (name: string, func: (...values: MutableValues<V>) => void) => void
82
+ /**
83
+ * Template syntax for name parameter:
84
+ * - `$property` - Access object property (when value is an object)
85
+ * - `$foo.bar` - Nested property access
86
+ * - `%#` - 0-based test index
87
+ * - `%$` - 1-based test index
88
+ * - `%p` - Pretty-format value
89
+ * - `%d`, `%s`, etc. - Lua format specifiers
90
+ */
91
+ each<const V extends readonly any[]>(
92
+ values: readonly V[],
93
+ ): (name: string, func: (this: void, ...values: MutableValues<V>) => void) => void
77
94
  each<const T>(values: readonly T[]): (name: string, func: (value: T) => void) => void
78
95
  }
79
96
 
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "factorio-test",
3
- "version": "1.1.1",
3
+ "version": "3.0.0",
4
4
  "description": "Type definitions for using Factorio Test with TypescriptToLua",
5
5
  "license": "MIT",
6
- "repository": "https://github.com/GlassBricks/FactorioTest",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/GlassBricks/FactorioTest.git"
9
+ },
7
10
  "files": [
8
11
  "index.d.ts"
9
12
  ],
10
13
  "peerDependencies": {
11
- "typed-factorio": ">=1.14.0"
12
- },
13
- "optionalDependencies": {
14
- "luassert-tstl": ">=0.2.3"
14
+ "typed-factorio": ">=2.0.0"
15
15
  }
16
16
  }