|
1 | | -import { OpenFeature, Client } from '@openfeature/js-sdk'; |
| 1 | +import { OpenFeature, Client, ErrorCode } from '@openfeature/js-sdk'; |
2 | 2 | import { LDClient } from 'launchdarkly-node-server-sdk'; |
3 | 3 | import { LaunchDarklyProvider } from '../src'; |
4 | 4 | import translateContext from '../src/translateContext'; |
@@ -210,12 +210,12 @@ describe('given a mock LaunchDarkly client', () => { |
210 | 210 | }); |
211 | 211 |
|
212 | 212 | it.each([ |
213 | | - ['CLIENT_NOT_READY', 'PROVIDER_NOT_READY'], |
214 | | - ['MALFORMED_FLAG', 'PARSE_ERROR'], |
215 | | - ['FLAG_NOT_FOUND', 'FLAG_NOT_FOUND'], |
216 | | - ['USER_NOT_SPECIFIED', 'GENERAL'], |
217 | | - ['UNSPECIFIED', 'GENERAL'], |
218 | | - [undefined, 'GENERAL'], |
| 213 | + ['CLIENT_NOT_READY', ErrorCode.PROVIDER_NOT_READY], |
| 214 | + ['MALFORMED_FLAG', ErrorCode.PARSE_ERROR], |
| 215 | + ['FLAG_NOT_FOUND', ErrorCode.FLAG_NOT_FOUND], |
| 216 | + ['USER_NOT_SPECIFIED', ErrorCode.TARGETING_KEY_MISSING], |
| 217 | + ['UNSPECIFIED', ErrorCode.GENERAL], |
| 218 | + [undefined, ErrorCode.GENERAL], |
219 | 219 | ])('handles errors from the client', async (ldError, ofError) => { |
220 | 220 | ldClient.variationDetail = jest.fn(async () => ({ |
221 | 221 | value: { yes: 'no' }, |
|
0 commit comments