@@ -4,30 +4,29 @@ import { ConfidenceServerProviderLocal } from './ConfidenceServerProviderLocal';
44import { readFileSync } from 'node:fs' ;
55import { WasmResolver } from './WasmResolver' ;
66
7- const {
8- CONFIDENCE_API_CLIENT_ID ,
9- CONFIDENCE_API_CLIENT_SECRET ,
10- } = requireEnv ( 'CONFIDENCE_API_CLIENT_ID' , 'CONFIDENCE_API_CLIENT_SECRET' ) ;
7+ const { CONFIDENCE_API_CLIENT_ID , CONFIDENCE_API_CLIENT_SECRET } = requireEnv (
8+ ' CONFIDENCE_API_CLIENT_ID' ,
9+ ' CONFIDENCE_API_CLIENT_SECRET' ,
10+ ) ;
1111
1212const moduleBytes = readFileSync ( __dirname + '/../../../wasm/confidence_resolver.wasm' ) ;
1313const module = new WebAssembly . Module ( moduleBytes ) ;
1414const resolver = await WasmResolver . load ( module ) ;
1515const confidenceProvider = new ConfidenceServerProviderLocal ( resolver , {
1616 flagClientSecret : 'RxDVTrXvc6op1XxiQ4OaR31dKbJ39aYV' ,
1717 apiClientId : CONFIDENCE_API_CLIENT_ID ,
18- apiClientSecret : CONFIDENCE_API_CLIENT_SECRET
18+ apiClientSecret : CONFIDENCE_API_CLIENT_SECRET ,
1919} ) ;
2020
2121describe ( 'ConfidenceServerProvider E2E tests' , ( ) => {
22- beforeAll ( async ( ) => {
23-
22+ beforeAll ( async ( ) => {
2423 await OpenFeature . setProviderAndWait ( confidenceProvider ) ;
2524 OpenFeature . setContext ( {
2625 targetingKey : 'test-a' , // control
2726 } ) ;
2827 } ) ;
2928
30- afterAll ( ( ) => OpenFeature . close ( ) )
29+ afterAll ( ( ) => OpenFeature . close ( ) ) ;
3130
3231 it ( 'should resolve a boolean e2e' , async ( ) => {
3332 const client = OpenFeature . getClient ( ) ;
@@ -86,13 +85,13 @@ describe('ConfidenceServerProvider E2E tests', () => {
8685 } ) ;
8786} ) ;
8887
89- function requireEnv < const N extends string [ ] > ( ...names :N ) : Record < N [ number ] , string > {
88+ function requireEnv < const N extends string [ ] > ( ...names : N ) : Record < N [ number ] , string > {
9089 return names . reduce ( ( acc , name ) => {
9190 const value = process . env [ name ] ;
92- if ( ! value ) throw new Error ( `Missing environment variable ${ name } ` )
91+ if ( ! value ) throw new Error ( `Missing environment variable ${ name } ` ) ;
9392 return {
9493 ...acc ,
95- [ name ] : value
94+ [ name ] : value ,
9695 } ;
97- } , { } ) as Record < N [ number ] , string > ;
98- }
96+ } , { } ) as Record < N [ number ] , string > ;
97+ }
0 commit comments