Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: loosen some test assertions, fix e2e matcher #933

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

toddbaert
Copy link
Member

Fixes a few issues in testing.

build:
context: test-harness
dockerfile: flagd/Dockerfile
image: ghcr.io/open-feature/flagd-testbed:v0.5.4
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use published images.

Comment on lines +27 to +28
// the below has to match quotes strings ("str") and numbers (3) to test an error input
and(/^a context containing a key "(.*)", with value "?([^"]*)"?$/, (key: string, value: string) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matcher probably should have never worked when we first added 3 as an error state, it looks like it was a bug eventually fixed in jest-gherkin. This regex matches "abc" and 3, which fixes the e2e test.

Comment on lines 142 to 148
expect(res).toEqual(expect.objectContaining({
flagKey: testFlagKey,
flagMetadata: {},
value: false,
reason: 'ERROR',
errorCode: 'TYPE_MISMATCH',
});
}));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've loosened a few brittle assertions with this PR, so that if new files are added/defaulted they don't break.

Signed-off-by: Todd Baert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants