@@ -8,13 +8,13 @@ import {
88 JsonObject ,
99 JsonValue ,
1010 OpenFeature ,
11- OpenFeatureClient ,
1211 Provider ,
1312 ProviderFatalError ,
1413 ProviderStatus ,
1514 ResolutionDetails ,
1615 StandardResolutionReasons ,
1716} from '../src' ;
17+ import { OpenFeatureClient } from '../src/client/open-feature-client' ;
1818
1919const BOOLEAN_VALUE = true ;
2020const STRING_VALUE = 'val' ;
@@ -382,7 +382,7 @@ describe('OpenFeatureClient', () => {
382382 // No generic information exists at runtime, but this test has some value in ensuring the generic args still exist in the typings.
383383 const client = OpenFeature . getClient ( ) ;
384384 const details : ResolutionDetails < JsonValue > = client . getObjectDetails ( 'flag' , { key : 'value' } ) ;
385-
385+
386386 expect ( details ) . toBeDefined ( ) ;
387387 } ) ;
388388 } ) ;
@@ -464,45 +464,45 @@ describe('OpenFeatureClient', () => {
464464 expect ( details . errorCode ) . toEqual ( ErrorCode . PROVIDER_NOT_READY ) ;
465465 } ) ;
466466 } ) ;
467-
467+
468468 describe ( 'Evaluation details structure' , ( ) => {
469469 const flagKey = 'number-details' ;
470470 const defaultValue = 1970 ;
471471 let details : EvaluationDetails < number > ;
472-
472+
473473 describe ( 'Normal execution' , ( ) => {
474474 beforeEach ( ( ) => {
475475 const client = OpenFeature . getClient ( ) ;
476476 details = client . getNumberDetails ( flagKey , defaultValue ) ;
477-
477+
478478 expect ( details ) . toBeDefined ( ) ;
479479 } ) ;
480-
480+
481481 describe ( 'Requirement 1.4.2, 1.4.3' , ( ) => {
482482 it ( 'should contain flag value' , ( ) => {
483483 expect ( details . value ) . toEqual ( NUMBER_VALUE ) ;
484484 } ) ;
485485 } ) ;
486-
486+
487487 describe ( 'Requirement 1.4.4' , ( ) => {
488488 it ( 'should contain flag key' , ( ) => {
489489 expect ( details . flagKey ) . toEqual ( flagKey ) ;
490490 } ) ;
491491 } ) ;
492-
492+
493493 describe ( 'Requirement 1.4.5' , ( ) => {
494494 it ( 'should contain flag variant' , ( ) => {
495495 expect ( details . variant ) . toEqual ( NUMBER_VARIANT ) ;
496496 } ) ;
497497 } ) ;
498-
498+
499499 describe ( 'Requirement 1.4.6' , ( ) => {
500500 it ( 'should contain reason' , ( ) => {
501501 expect ( details . reason ) . toEqual ( REASON ) ;
502502 } ) ;
503503 } ) ;
504504 } ) ;
505-
505+
506506 describe ( 'Abnormal execution' , ( ) => {
507507 const NON_OPEN_FEATURE_ERROR_MESSAGE = 'A null dereference or something, I dunno.' ;
508508 const OPEN_FEATURE_ERROR_MESSAGE = "This ain't the flag you're looking for." ;
@@ -522,68 +522,68 @@ describe('OpenFeatureClient', () => {
522522 } as unknown as Provider ;
523523 const defaultNumberValue = 123 ;
524524 const defaultStringValue = 'hey!' ;
525-
525+
526526 beforeEach ( ( ) => {
527527 OpenFeature . setProvider ( errorProvider ) ;
528528 client = OpenFeature . getClient ( ) ;
529529 nonOpenFeatureErrorDetails = client . getNumberDetails ( 'some-flag' , defaultNumberValue ) ;
530530 openFeatureErrorDetails = client . getStringDetails ( 'some-flag' , defaultStringValue ) ;
531531 } ) ;
532-
532+
533533 describe ( 'Requirement 1.4.7' , ( ) => {
534534 describe ( 'OpenFeatureError' , ( ) => {
535535 it ( 'should contain error code' , ( ) => {
536536 expect ( openFeatureErrorDetails . errorCode ) . toBeTruthy ( ) ;
537537 expect ( openFeatureErrorDetails . errorCode ) . toEqual ( ErrorCode . FLAG_NOT_FOUND ) ; // should get code from thrown OpenFeatureError
538538 } ) ;
539539 } ) ;
540-
540+
541541 describe ( 'Non-OpenFeatureError' , ( ) => {
542542 it ( 'should contain error code' , ( ) => {
543543 expect ( nonOpenFeatureErrorDetails . errorCode ) . toBeTruthy ( ) ;
544544 expect ( nonOpenFeatureErrorDetails . errorCode ) . toEqual ( ErrorCode . GENERAL ) ; // should fall back to GENERAL
545545 } ) ;
546546 } ) ;
547547 } ) ;
548-
548+
549549 describe ( 'Requirement 1.4.8' , ( ) => {
550550 it ( 'should contain error reason' , ( ) => {
551551 expect ( nonOpenFeatureErrorDetails . reason ) . toEqual ( StandardResolutionReasons . ERROR ) ;
552552 expect ( openFeatureErrorDetails . reason ) . toEqual ( StandardResolutionReasons . ERROR ) ;
553553 } ) ;
554554 } ) ;
555-
555+
556556 describe ( 'Requirement 1.4.9' , ( ) => {
557557 it ( 'must not throw, must return default' , ( ) => {
558558 nonOpenFeatureErrorDetails = client . getNumberDetails ( 'some-flag' , defaultNumberValue ) ;
559-
559+
560560 expect ( nonOpenFeatureErrorDetails ) . toBeTruthy ( ) ;
561561 expect ( nonOpenFeatureErrorDetails . value ) . toEqual ( defaultNumberValue ) ;
562562 } ) ;
563563 } ) ;
564-
564+
565565 describe ( 'Requirement 1.4.12' , ( ) => {
566566 describe ( 'OpenFeatureError' , ( ) => {
567567 it ( 'should contain "error" message' , ( ) => {
568568 expect ( openFeatureErrorDetails . errorMessage ) . toEqual ( OPEN_FEATURE_ERROR_MESSAGE ) ;
569569 } ) ;
570570 } ) ;
571-
571+
572572 describe ( 'Non-OpenFeatureError' , ( ) => {
573573 it ( 'should contain "error" message' , ( ) => {
574574 expect ( nonOpenFeatureErrorDetails . errorMessage ) . toEqual ( NON_OPEN_FEATURE_ERROR_MESSAGE ) ;
575575 } ) ;
576576 } ) ;
577577 } ) ;
578578 } ) ;
579-
579+
580580 describe ( 'Requirement 1.4.13, Requirement 1.4.14' , ( ) => {
581581 it ( 'should return immutable `flag metadata` as defined by the provider' , ( ) => {
582582 const flagMetadata = {
583583 url : 'https://test.dev' ,
584584 version : '1' ,
585585 } ;
586-
586+
587587 const flagMetadataProvider = {
588588 metadata : {
589589 name : 'flag-metadata' ,
@@ -595,14 +595,14 @@ describe('OpenFeatureClient', () => {
595595 } ;
596596 } ) ,
597597 } as unknown as Provider ;
598-
598+
599599 OpenFeature . setProvider ( flagMetadataProvider ) ;
600600 const client = OpenFeature . getClient ( ) ;
601601 const response = client . getBooleanDetails ( 'some-flag' , false ) ;
602602 expect ( response . flagMetadata ) . toBe ( flagMetadata ) ;
603603 expect ( Object . isFrozen ( response . flagMetadata ) ) . toBeTruthy ( ) ;
604604 } ) ;
605-
605+
606606 it ( 'should return empty `flag metadata` because it was not set by the provider' , ( ) => {
607607 // The mock provider doesn't contain flag metadata
608608 OpenFeature . setProvider ( MOCK_PROVIDER ) ;
0 commit comments