Skip to content

Commit 6c38f38

Browse files
committed
chore(js): formatting
1 parent 533e67f commit 6c38f38

19 files changed

+875
-903
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ RUN make install
392392

393393
# Copy source and config
394394
COPY openfeature-provider/js/src ./src/
395-
COPY openfeature-provider/js/tsconfig.json openfeature-provider/js/tsdown.config.ts openfeature-provider/js/vitest.config.ts ./
395+
COPY openfeature-provider/js/tsconfig.json openfeature-provider/js/tsdown.config.ts openfeature-provider/js/vitest.config.ts openfeature-provider/js/prettier.config.cjs openfeature-provider/js/.prettierignore ./
396396
COPY openfeature-provider/js/Makefile ./
397397

398398
# Copy WASM module

openfeature-provider/js/src/ConfidenceServerProviderLocal.e2e.test.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ import { ConfidenceServerProviderLocal } from './ConfidenceServerProviderLocal';
44
import { readFileSync } from 'node:fs';
55
import { WasmResolver } from './WasmResolver';
66

7-
const {
8-
JS_E2E_CONFIDENCE_API_CLIENT_ID,
9-
JS_E2E_CONFIDENCE_API_CLIENT_SECRET,
10-
} = requireEnv('JS_E2E_CONFIDENCE_API_CLIENT_ID', 'JS_E2E_CONFIDENCE_API_CLIENT_SECRET');
7+
const { JS_E2E_CONFIDENCE_API_CLIENT_ID, JS_E2E_CONFIDENCE_API_CLIENT_SECRET } = requireEnv(
8+
'JS_E2E_CONFIDENCE_API_CLIENT_ID',
9+
'JS_E2E_CONFIDENCE_API_CLIENT_SECRET',
10+
);
1111

1212
const moduleBytes = readFileSync(__dirname + '/../../../wasm/confidence_resolver.wasm');
1313
const module = new WebAssembly.Module(moduleBytes);
1414
const resolver = new WasmResolver(module);
1515
const confidenceProvider = new ConfidenceServerProviderLocal(resolver, {
1616
flagClientSecret: 'RxDVTrXvc6op1XxiQ4OaR31dKbJ39aYV',
1717
apiClientId: JS_E2E_CONFIDENCE_API_CLIENT_ID,
18-
apiClientSecret: JS_E2E_CONFIDENCE_API_CLIENT_SECRET
18+
apiClientSecret: JS_E2E_CONFIDENCE_API_CLIENT_SECRET,
1919
});
2020

2121
describe('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();
@@ -87,24 +86,26 @@ describe('ConfidenceServerProvider E2E tests', () => {
8786

8887
it('should resolve a flag with a sticky resolve', async () => {
8988
const client = OpenFeature.getClient();
90-
const result = await client.getNumberDetails('web-sdk-e2e-flag.double', -1, { targetingKey: 'test-a', sticky: true });
91-
89+
const result = await client.getNumberDetails('web-sdk-e2e-flag.double', -1, {
90+
targetingKey: 'test-a',
91+
sticky: true,
92+
});
93+
9294
// The flag has a running experiment with a sticky assignment. The intake is paused but we should still get the sticky assignment.
9395
// If this test breaks it could mean that the experiment was removed or that the bigtable materialization was cleaned out.
9496
expect(result.value).toBe(99.99);
9597
expect(result.variant).toBe('flags/web-sdk-e2e-flag/variants/sticky');
9698
expect(result.reason).toBe('MATCH');
97-
9899
});
99100
});
100101

101-
function requireEnv<const N extends string[]>(...names:N): Record<N[number],string> {
102+
function requireEnv<const N extends string[]>(...names: N): Record<N[number], string> {
102103
return names.reduce((acc, name) => {
103104
const value = process.env[name];
104-
if(!value) throw new Error(`Missing environment variable ${name}`)
105+
if (!value) throw new Error(`Missing environment variable ${name}`);
105106
return {
106107
...acc,
107-
[name]: value
108+
[name]: value,
108109
};
109-
}, {}) as Record<N[number],string>;
110-
}
110+
}, {}) as Record<N[number], string>;
111+
}

0 commit comments

Comments
 (0)