Skip to content

Commit 094cb19

Browse files
committed
fixup: revert generalization attempt
Signed-off-by: Simon Schrottner <[email protected]>
1 parent 10df4a4 commit 094cb19

18 files changed

+36
-30
lines changed

libs/providers/flagd-web/schemas

libs/providers/flagd-web/src/e2e/jest.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: './tsconfig.lib.json' }],
55
},
66
moduleNameMapper: {
7+
'@openfeature/flagd-core': ['<rootDir>/../../../../shared/flagd-core/src'],
78
'^(.*)\\.js$': ['$1.js', '$1.ts', '$1'],
89
},
910
testEnvironment: 'node',

libs/providers/flagd-web/src/e2e/tests/provider.spec.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import assert from 'assert';
2-
import { OpenFeature } from '@openfeature/web-sdk';
2+
import { Client, OpenFeature } from '@openfeature/web-sdk';
33
import { GenericContainer, StartedTestContainer } from 'testcontainers';
44
import { FlagdWebProvider } from '../../lib/flagd-web-provider';
55
import { autoBindSteps, loadFeature } from 'jest-cucumber';
6-
import { flagStepDefinitions, GHERKIN_EVALUATION_FEATURE, IMAGE_VERSION } from '@openfeature/flagd-core';
6+
import {
7+
E2E_CLIENT_NAME,
8+
flagStepDefinitions,
9+
GHERKIN_EVALUATION_FEATURE,
10+
IMAGE_VERSION,
11+
} from '@openfeature/flagd-core';
712

813
// register the flagd provider before the tests.
914
async function setup() {
@@ -16,6 +21,7 @@ async function setup() {
1621
.start();
1722
containers.push(stable);
1823
OpenFeature.setProvider(
24+
E2E_CLIENT_NAME,
1925
new FlagdWebProvider({
2026
host: stable.getHost(),
2127
port: stable.getMappedPort(8013),
@@ -24,9 +30,9 @@ async function setup() {
2430
}),
2531
);
2632
assert(
27-
OpenFeature.providerMetadata.name === FlagdWebProvider.name,
33+
OpenFeature.getProviderMetadata(E2E_CLIENT_NAME).name === E2E_CLIENT_NAME,
2834
new Error(
29-
`Expected ${FlagdWebProvider.name} provider to be configured, instead got: ${OpenFeature.providerMetadata.name}`,
35+
`Expected ${E2E_CLIENT_NAME} provider to be configured, instead got: ${OpenFeature.providerMetadata.name}`,
3036
),
3137
);
3238
console.log('flagd provider configured!');
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"lib": ["ES2015", "DOM"],
4+
"lib": ["ES2022", "DOM"],
55
"outDir": "../../../dist/out-tsc",
66
"declaration": true,
77
"types": ["jest"],
88
"allowSyntheticDefaultImports": true,
9-
"allowJs" :true
9+
"allowJs" :true,
10+
"resolveJsonModule": true
1011
}
1112
}

libs/providers/flagd/src/e2e/tests/in-process-reconnect.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { FlagdProvider } from '../../lib/flagd-provider';
44
import { GenericContainer, StartedTestContainer } from 'testcontainers';
55
import { autoBindSteps, loadFeature } from 'jest-cucumber';
66
import {
7-
FLAGD_NAME,
8-
IMAGE_VERSION,
9-
UNAVAILABLE_CLIENT_NAME,
107
UNSTABLE_CLIENT_NAME,
11-
reconnectStepDefinitions,
8+
UNAVAILABLE_CLIENT_NAME,
9+
FLAGD_NAME,
1210
GHERKIN_FLAGD_RECONNECT_FEATURE,
13-
} from '@openfeature/flagd-core';
11+
IMAGE_VERSION,
12+
} from '../constants';
13+
import { reconnectStepDefinitions } from '../step-definitions';
1414

1515
// register the flagd provider before the tests.
1616
async function setup() {

libs/providers/flagd/src/e2e/tests/in-process.spec.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import { autoBindSteps, loadFeature } from 'jest-cucumber';
66
import {
77
E2E_CLIENT_NAME,
88
FLAGD_NAME,
9-
IMAGE_VERSION,
10-
flagStepDefinitions,
11-
getGherkinTestPath,
12-
GHERKIN_FLAGD_FEATURE,
139
GHERKIN_EVALUATION_FEATURE,
10+
GHERKIN_FLAGD_FEATURE,
1411
GHERKIN_FLAGD_JSON_EVALUATOR_FEATURE,
15-
} from '@openfeature/flagd-core';
12+
IMAGE_VERSION,
13+
} from '../constants';
14+
import { flagStepDefinitions } from '../step-definitions';
1615

1716
// register the flagd provider before the tests.
1817
async function setup() {

libs/providers/flagd/src/e2e/tests/rpc-reconnect.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { FlagdProvider } from '../../lib/flagd-provider';
44
import { GenericContainer, StartedTestContainer } from 'testcontainers';
55
import { autoBindSteps, loadFeature } from 'jest-cucumber';
66
import {
7-
FLAGD_NAME,
8-
IMAGE_VERSION,
9-
UNAVAILABLE_CLIENT_NAME,
107
UNSTABLE_CLIENT_NAME,
11-
reconnectStepDefinitions,
8+
UNAVAILABLE_CLIENT_NAME,
9+
FLAGD_NAME,
1210
GHERKIN_FLAGD_RECONNECT_FEATURE,
13-
} from '@openfeature/flagd-core';
11+
IMAGE_VERSION,
12+
} from '../constants';
13+
import { reconnectStepDefinitions } from '../step-definitions';
1414

1515
// register the flagd provider before the tests.
1616
async function setup() {

libs/providers/flagd/src/e2e/tests/rpc.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { autoBindSteps, loadFeature } from 'jest-cucumber';
66
import {
77
E2E_CLIENT_NAME,
88
FLAGD_NAME,
9-
IMAGE_VERSION,
10-
flagStepDefinitions,
11-
GHERKIN_FLAGD_FEATURE,
129
GHERKIN_EVALUATION_FEATURE,
10+
GHERKIN_FLAGD_FEATURE,
1311
GHERKIN_FLAGD_JSON_EVALUATOR_FEATURE,
14-
} from '@openfeature/flagd-core';
12+
IMAGE_VERSION,
13+
} from '../constants';
14+
import { flagStepDefinitions } from '../step-definitions';
1515

1616
// register the flagd provider before the tests.
1717
async function setup() {

libs/shared/flagd-core/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export * from './lib/flagd-core';
22
export * from './lib/feature-flag';
33
export * from './lib/storage';
4-
export * from './e2e';

libs/shared/flagd-core/tsconfig.lib.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"types": []
77
},
88
"include": ["src/**/*.ts"],
9-
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/e2e"]
9+
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
1010
}

libs/shared/flagd-core/tsconfig.spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts", "src/e2e"]
8+
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
99
}

0 commit comments

Comments
 (0)