-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new experimental ea command flag (#1027)
* feat: add experimental early access feature command * update documentation for experimental features and add logging instruction * update test: should dump tenant.yaml without defaults as AUTH0_EXPERIMENTAL_EA=false * Include new screens to support ACUL (#1028) Co-authored-by: Kushal <[email protected]> --------- Co-authored-by: Ramya Anusri <[email protected]>
- Loading branch information
1 parent
9766cb7
commit 11e068b
Showing
13 changed files
with
377 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { expect } from 'chai'; | ||
import { configFactory, ConfigFunction } from '../src/configFactory'; | ||
import { Config } from '../src/types'; | ||
|
||
describe('configFactory', () => { | ||
let config: ReturnType<typeof configFactory>; | ||
|
||
beforeEach(() => { | ||
config = configFactory(); | ||
}); | ||
|
||
it('should set and get configuration values', () => { | ||
config.setValue('someKey' as keyof Config, 'someValue'); | ||
expect(config('someKey' as keyof Config)).to.equal('someValue'); | ||
}); | ||
|
||
it('should throw an error if no provider is set and key is not in settings', () => { | ||
expect(() => config('someKey' as keyof Config)).to.throw( | ||
'A configuration provider has not been set' | ||
); | ||
}); | ||
|
||
it('should use the provider function to get configuration values', () => { | ||
const providerFunction: ConfigFunction = (key) => { | ||
if ((key as string) === 'someKey') return 'providedValue'; | ||
return null; | ||
}; | ||
config.setProvider(providerFunction); | ||
expect(config('someKey' as keyof Config)).to.equal('providedValue'); | ||
}); | ||
|
||
it('should prioritize settings over provider function', () => { | ||
config.setValue('someKey' as keyof Config, 'someValue'); | ||
const providerFunction: ConfigFunction = (key) => { | ||
if ((key as string) === 'someKey') return 'providedValue'; | ||
return null; | ||
}; | ||
config.setProvider(providerFunction); | ||
expect(config('someKey' as keyof Config)).to.equal('someValue'); | ||
}); | ||
}); |
Oops, something went wrong.