Skip to content

Commit

Permalink
chore: import fixes to fix e2e tests (#471)
Browse files Browse the repository at this point in the history
Both the server and client e2e tests run fine in the CI, but in some
local scenarios the "deep imports" we used were causing issues with
module resolution.

I've updated the e2e test to always import from the "top level" instead
of the /src sub-directory in the test suite.

Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Jun 29, 2023
1 parent a8703ed commit d26c4ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/client/e2e/step-definitions/evaluation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ResolutionDetails,
StandardResolutionReasons,
} from '@openfeature/shared';
import { OpenFeature, ProviderEvents } from '../../src';
import { OpenFeature, ProviderEvents } from '../..';
// load the feature file.
const feature = loadFeature('packages/client/e2e/features/evaluation.feature');

Expand Down
2 changes: 1 addition & 1 deletion packages/client/e2e/step-definitions/setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import { OpenFeature } from '../../';
import { OpenFeature } from '../..';
import { FlagdWebProvider } from '@openfeature/flagd-web-provider';

const FLAGD_NAME = 'flagd-web';
Expand Down
2 changes: 1 addition & 1 deletion packages/server/e2e/step-definitions/evaluation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
StandardResolutionReasons,
ProviderEvents,
} from '@openfeature/shared';
import { OpenFeature } from './../../src';
import { OpenFeature } from '../..';
// load the feature file.
const feature = loadFeature('packages/server/e2e/features/evaluation.feature');

Expand Down
8 changes: 5 additions & 3 deletions packages/server/e2e/step-definitions/setup.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

import assert from 'assert';
import { OpenFeature } from '../../src';
import { OpenFeature } from '../..';
import { FlagdProvider } from '@openfeature/flagd-provider';

const FLAGD_NAME = 'flagd Provider';

// register the flagd provider before the tests.
console.log('Setting flagd provider...');
OpenFeature.setProvider(new FlagdProvider({ cache: 'disabled' }));
assert(OpenFeature.providerMetadata.name === FLAGD_NAME, new Error(`Expected ${FLAGD_NAME} provider to be configured, instead got: ${OpenFeature.providerMetadata.name}`));
assert(
OpenFeature.providerMetadata.name === FLAGD_NAME,
new Error(`Expected ${FLAGD_NAME} provider to be configured, instead got: ${OpenFeature.providerMetadata.name}`)
);
console.log('flagd provider configured!');

0 comments on commit d26c4ee

Please sign in to comment.