@@ -4,8 +4,6 @@ import { ReflagClient } from "../src/client";
44import { FlagsClient } from "../src/flag/flags" ;
55import { HttpClient } from "../src/httpClient" ;
66
7- import { flagsResult } from "./mocks/handlers" ;
8-
97describe ( "ReflagClient" , ( ) => {
108 let client : ReflagClient ;
119 const httpClientPost = vi . spyOn ( HttpClient . prototype as any , "post" ) ;
@@ -65,18 +63,6 @@ describe("ReflagClient", () => {
6563 } ) ;
6664 } ) ;
6765
68- describe ( "getFeature (deprecated)" , ( ) => {
69- it ( "takes overrides into account" , async ( ) => {
70- await client . initialize ( ) ;
71-
72- expect ( flagsResult [ "flagA" ] . isEnabled ) . toBe ( true ) ;
73- expect ( client . getFeature ( "flagA" ) . isEnabled ) . toBe ( true ) ;
74-
75- client . getFeature ( "flagA" ) . setIsEnabledOverride ( false ) ;
76- expect ( client . getFeature ( "flagA" ) . isEnabled ) . toBe ( false ) ;
77- } ) ;
78- } ) ;
79-
8066 describe ( "getFlag" , ( ) => {
8167 beforeEach ( async ( ) => {
8268 await client . initialize ( ) ;
@@ -143,8 +129,6 @@ describe("ReflagClient", () => {
143129 const userHook = vi . fn ( ) ;
144130 const companyHook = vi . fn ( ) ;
145131 const checkHook = vi . fn ( ) ;
146- const checkHookIsEnabled = vi . fn ( ) ;
147- const checkHookConfig = vi . fn ( ) ;
148132 const flagsUpdated = vi . fn ( ) ;
149133
150134 beforeEach ( async ( ) => {
@@ -154,16 +138,12 @@ describe("ReflagClient", () => {
154138 client . on ( "user" , userHook ) ;
155139 client . on ( "company" , companyHook ) ;
156140 client . on ( "check" , checkHook ) ;
157- client . on ( "configCheck" , checkHookConfig ) ;
158- client . on ( "enabledCheck" , checkHookIsEnabled ) ;
159141 client . on ( "flagsUpdated" , flagsUpdated ) ;
160142
161143 trackHook . mockReset ( ) ;
162144 userHook . mockReset ( ) ;
163145 companyHook . mockReset ( ) ;
164146 checkHook . mockReset ( ) ;
165- checkHookIsEnabled . mockReset ( ) ;
166- checkHookConfig . mockReset ( ) ;
167147 flagsUpdated . mockReset ( ) ;
168148 } ) ;
169149
@@ -172,8 +152,6 @@ describe("ReflagClient", () => {
172152 client . off ( "user" , userHook ) ;
173153 client . off ( "company" , companyHook ) ;
174154 client . off ( "check" , checkHook ) ;
175- client . off ( "configCheck" , checkHookConfig ) ;
176- client . off ( "enabledCheck" , checkHookIsEnabled ) ;
177155 client . off ( "flagsUpdated" , flagsUpdated ) ;
178156 } ) ;
179157
@@ -246,23 +224,19 @@ describe("ReflagClient", () => {
246224 version : 1 ,
247225 } ;
248226
249- expect ( checkHookIsEnabled ) . toHaveBeenCalledWith ( checkEvent ) ;
250227 expect ( checkHook ) . toHaveBeenCalledWith ( checkEvent ) ;
251228
252229 // Remove hooks
253230 client . off ( "check" , checkHook ) ;
254- client . off ( "enabledCheck" , checkHookIsEnabled ) ;
255231
256232 // Reset mocks
257233 checkHook . mockReset ( ) ;
258- checkHookIsEnabled . mockReset ( ) ;
259234
260235 // Trigger events again
261236 client . getFlag ( "flagA" ) ;
262237
263238 // Ensure hooks are not called
264239 expect ( checkHook ) . not . toHaveBeenCalled ( ) ;
265- expect ( checkHookIsEnabled ) . not . toHaveBeenCalled ( ) ;
266240 } ) ;
267241
268242 it ( "check (config)" , async ( ) => {
@@ -284,20 +258,16 @@ describe("ReflagClient", () => {
284258 } ;
285259
286260 expect ( checkHook ) . toHaveBeenCalledWith ( checkEvent ) ;
287- expect ( checkHookConfig ) . toHaveBeenCalledWith ( checkEvent ) ;
288261
289262 client . off ( "check" , checkHook ) ;
290- client . off ( "configCheck" , checkHookConfig ) ;
291263
292264 // Reset mocks
293265 checkHook . mockReset ( ) ;
294- checkHookConfig . mockReset ( ) ;
295266
296267 client . getFlag ( "flagB" ) ;
297268
298269 // Ensure hooks are not called
299270 expect ( checkHook ) . not . toHaveBeenCalled ( ) ;
300- expect ( checkHookConfig ) . not . toHaveBeenCalled ( ) ;
301271 } ) ;
302272
303273 it ( "flagsUpdated" , async ( ) => {
0 commit comments