|
1 |
| -import { expectError, expectType } from 'tsd'; |
| 1 | +import { expectError, expectType } from 'tsd' |
2 | 2 |
|
3 |
| - |
4 |
| -expectError(Feature()); |
5 |
| -expectError(Scenario()); |
6 |
| -expectError(Before()); |
7 |
| -expectError(BeforeSuite()); |
8 |
| -expectError(After()); |
9 |
| -expectError(AfterSuite()); |
| 3 | +expectError(Feature()) |
| 4 | +expectError(Scenario()) |
| 5 | +expectError(Before()) |
| 6 | +expectError(BeforeSuite()) |
| 7 | +expectError(After()) |
| 8 | +expectError(AfterSuite()) |
10 | 9 |
|
11 | 10 | // @ts-ignore
|
12 | 11 | expectType<CodeceptJS.FeatureConfig>(Feature('feature'))
|
13 | 12 |
|
| 13 | +// @ts-ignore |
| 14 | +expectType<CodeceptJS.FeatureConfig>(Feature.only('feature')) |
| 15 | + |
| 16 | +// @ts-ignore |
| 17 | +expectType<CodeceptJS.FeatureConfig>(Feature.only('feature', {})) |
| 18 | + |
| 19 | +// @ts-ignore |
| 20 | +expectType<CodeceptJS.FeatureConfig>(Feature.skip('feature')) |
| 21 | + |
14 | 22 | // @ts-ignore
|
15 | 23 | expectType<CodeceptJS.ScenarioConfig>(Scenario('scenario'))
|
16 | 24 |
|
17 | 25 | // @ts-ignore
|
18 |
| -expectType<CodeceptJS.ScenarioConfig>(Scenario( |
19 |
| - 'scenario', |
20 |
| - {}, // $ExpectType {} |
21 |
| - () => {} // $ExpectType () => void |
22 |
| -)) |
| 26 | +expectType<CodeceptJS.ScenarioConfig>( |
| 27 | + Scenario( |
| 28 | + 'scenario', |
| 29 | + {}, // $ExpectType {} |
| 30 | + () => {}, // $ExpectType () => void |
| 31 | + ), |
| 32 | +) |
23 | 33 |
|
24 | 34 | // @ts-ignore
|
25 |
| -expectType<CodeceptJS.ScenarioConfig>(Scenario( |
26 |
| - 'scenario', |
27 |
| - () => {} // $ExpectType () => void |
28 |
| -)) |
| 35 | +expectType<CodeceptJS.ScenarioConfig>( |
| 36 | + Scenario( |
| 37 | + 'scenario', |
| 38 | + () => {}, // $ExpectType () => void |
| 39 | + ), |
| 40 | +) |
29 | 41 |
|
30 | 42 | // @ts-ignore
|
31 | 43 | const callback: CodeceptJS.HookCallback = () => {}
|
32 | 44 |
|
33 | 45 | // @ts-ignore
|
34 |
| -expectType<CodeceptJS.ScenarioConfig>(Scenario( |
35 |
| - 'scenario', |
36 |
| - callback // $ExpectType HookCallback |
37 |
| -)) |
| 46 | +expectType<CodeceptJS.ScenarioConfig>( |
| 47 | + Scenario( |
| 48 | + 'scenario', |
| 49 | + callback, // $ExpectType HookCallback |
| 50 | + ), |
| 51 | +) |
38 | 52 |
|
39 | 53 | // @ts-ignore
|
40 |
| -expectType<CodeceptJS.ScenarioConfig>(Scenario('scenario', |
41 |
| - (args) => { |
| 54 | +expectType<CodeceptJS.ScenarioConfig>( |
| 55 | + Scenario('scenario', args => { |
42 | 56 | // @ts-ignore
|
43 | 57 | expectType<CodeceptJS.SupportObject>(args)
|
44 | 58 | // @ts-ignore
|
45 | 59 | expectType<CodeceptJS.I>(args.I) // $ExpectType I
|
46 |
| - } |
47 |
| -)) |
| 60 | + }), |
| 61 | +) |
48 | 62 |
|
49 | 63 | // @ts-ignore
|
50 |
| -expectType<CodeceptJS.ScenarioConfig>(Scenario( |
51 |
| - 'scenario', |
52 |
| - async () => {} // $ExpectType () => Promise<void> |
53 |
| -)) |
| 64 | +expectType<CodeceptJS.ScenarioConfig>( |
| 65 | + Scenario( |
| 66 | + 'scenario', |
| 67 | + async () => {}, // $ExpectType () => Promise<void> |
| 68 | + ), |
| 69 | +) |
54 | 70 |
|
55 | 71 | // @ts-ignore
|
56 |
| -expectType<void>(Before((args) => { |
57 |
| - // @ts-ignore |
58 |
| - expectType<CodeceptJS.SupportObject>(args) |
59 |
| - // @ts-ignore |
60 |
| - expectType<CodeceptJS.I>(args.I) |
61 |
| -})) |
| 72 | +expectType<void>( |
| 73 | + Before(args => { |
| 74 | + // @ts-ignore |
| 75 | + expectType<CodeceptJS.SupportObject>(args) |
| 76 | + // @ts-ignore |
| 77 | + expectType<CodeceptJS.I>(args.I) |
| 78 | + }), |
| 79 | +) |
62 | 80 |
|
63 | 81 | // @ts-ignore
|
64 |
| -expectType<void>(BeforeSuite((args) => { |
65 |
| - // @ts-ignore |
66 |
| - expectType<CodeceptJS.SupportObject>(args) |
67 |
| - // @ts-ignore |
68 |
| - expectType<CodeceptJS.I>(args.I) |
69 |
| -})) |
| 82 | +expectType<void>( |
| 83 | + BeforeSuite(args => { |
| 84 | + // @ts-ignore |
| 85 | + expectType<CodeceptJS.SupportObject>(args) |
| 86 | + // @ts-ignore |
| 87 | + expectType<CodeceptJS.I>(args.I) |
| 88 | + }), |
| 89 | +) |
70 | 90 |
|
71 | 91 | // @ts-ignore
|
72 |
| -expectType<void>(After((args) => { |
73 |
| - // @ts-ignore |
74 |
| - expectType<CodeceptJS.SupportObject>(args) |
75 |
| - // @ts-ignore |
76 |
| - expectType<CodeceptJS.I>(args.I) |
77 |
| -})) |
| 92 | +expectType<void>( |
| 93 | + After(args => { |
| 94 | + // @ts-ignore |
| 95 | + expectType<CodeceptJS.SupportObject>(args) |
| 96 | + // @ts-ignore |
| 97 | + expectType<CodeceptJS.I>(args.I) |
| 98 | + }), |
| 99 | +) |
78 | 100 |
|
79 | 101 | // @ts-ignore
|
80 |
| -expectType<void>(AfterSuite((args) => { |
81 |
| - // @ts-ignore |
82 |
| - expectType<CodeceptJS.SupportObject>(args) |
83 |
| - // @ts-ignore |
84 |
| - expectType<CodeceptJS.I>(args.I) |
85 |
| -})) |
| 102 | +expectType<void>( |
| 103 | + AfterSuite(args => { |
| 104 | + // @ts-ignore |
| 105 | + expectType<CodeceptJS.SupportObject>(args) |
| 106 | + // @ts-ignore |
| 107 | + expectType<CodeceptJS.I>(args.I) |
| 108 | + }), |
| 109 | +) |
86 | 110 |
|
87 | 111 | // @ts-ignore
|
88 |
| -expectType<Promise<boolean>>(tryTo(() => { |
89 |
| - return true; |
90 |
| -})); |
| 112 | +expectType<Promise<boolean>>( |
| 113 | + tryTo(() => { |
| 114 | + return true |
| 115 | + }), |
| 116 | +) |
91 | 117 |
|
92 | 118 | // @ts-ignore
|
93 |
| -expectType<Promise<boolean>>(tryTo(async () => { |
94 |
| - return false; |
95 |
| -})); |
| 119 | +expectType<Promise<boolean>>( |
| 120 | + tryTo(async () => { |
| 121 | + return false |
| 122 | + }), |
| 123 | +) |
0 commit comments