You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or, you can submit the switcher request and get the criteria response, which contains result, reason and metadata that can be used for any additional verification.
181
+
Or, you can submit the switcher request and get the switcher result, which contains result, reason and metadata that can be used for any additional verification.
159
182
160
183
```java
161
-
CriteriaResponse response= switcher.submit();
162
-
response.isItOn(); // true/false
163
-
response.getReason(); // Descriptive response based on result value
164
-
response.getMetadata(YourMetadata.class); // Additional information
184
+
SwitcherResult result= switcher.submit();
185
+
result.isItOn(); // true/false
186
+
result.getReason(); // Descriptive response based on result value
187
+
result.getMetadata(YourMetadata.class); // Additional information
165
188
```
166
189
167
190
2.**Strategy validation - preparing input**
@@ -292,13 +315,23 @@ Write automated tests using this built-in test annotation to guide your test sce
Forcing Switchers to resolve remotely can help you define exclusive features that cannot be resolved locally.
139
139
This feature is ideal if you want to run the SDK in local mode but still want to resolve a specific switcher remotely.
140
140
141
-
```ts
141
+
```js
142
142
constswitcher=Client.getSwitcher();
143
143
awaitswitcher.remote().isItOn('FEATURE01');
144
144
```
145
145
146
146
</br>
147
147
148
148
##### - Built-in mock feature
149
-
You can also bypass your switcher configuration by invoking 'Client.assume'. This is perfect for your test code where you want to test both scenarios when the switcher is true and false.
149
+
You can also bypass your switcher configuration by invoking 'Client.assume'. This is perfect for your test code where you want to validate both scenarios when the switcher is true and false.
150
150
151
151
```js
152
152
Client.assume('FEATURE01').true();
@@ -158,6 +158,12 @@ switcher.isItOn('FEATURE01'); // Now, it's going to return the result retrieved
158
158
Client.assume('FEATURE01').false().withMetadata({ message:'Feature is disabled' }); // Include metadata to emulate Relay response
0 commit comments