Skip to content

Commit 6ff30c7

Browse files
committed
Add unit test for config feature
Signed-off-by: Marko Mlakar <marko.mlakar@dynatrace.com>
1 parent bfb10a3 commit 6ff30c7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

libs/providers/flagd/src/e2e/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const UNSTABLE_CLIENT_NAME = 'unstable';
55
export const UNAVAILABLE_CLIENT_NAME = 'unavailable';
66

77
export const GHERKIN_FLAGD = getGherkinTestPath('*.feature');
8+
export const CONFIG_FEATURE = getGherkinTestPath('config.feature');
89
export const CONNECTION_FEATURE = getGherkinTestPath('connection.feature');
910
export const CONTEXT_ENRICHMENT_FEATURE = getGherkinTestPath('contextEnrichment.feature');
1011
export const EVALUATION_FEATURE = getGherkinTestPath('evaluation.feature');
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { configSteps } from '../step-definitions/configSteps';
2+
import type { State } from '../step-definitions/state';
3+
import { autoBindSteps, loadFeatures } from 'jest-cucumber';
4+
import { CONFIG_FEATURE } from '../constants';
5+
6+
jest.setTimeout(50000);
7+
describe('config', () => {
8+
const state: State = {
9+
resolverType: 'in-process',
10+
options: {},
11+
config: undefined,
12+
events: [],
13+
};
14+
autoBindSteps(
15+
loadFeatures(CONFIG_FEATURE, {
16+
scenarioNameTemplate: (vars) => {
17+
return `${vars.scenarioTitle} (${vars.scenarioTags.join(',')} ${vars.featureTags.join(',')})`;
18+
},
19+
}),
20+
[configSteps(state)],
21+
);
22+
});

0 commit comments

Comments
 (0)