-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73bd9f6
commit 3aa3b71
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
packages/kbn-test/src/functional_test_runner/lib/config/config.test.ts
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,26 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { Config } from './config'; | ||
|
||
describe('Config', () => { | ||
it('recognize keys under `object().pattern`', () => { | ||
const config = new Config({ | ||
settings: { | ||
services: { | ||
foo: () => 42, | ||
}, | ||
}, | ||
primary: true, | ||
path: process.cwd(), | ||
}); | ||
|
||
expect(config.has('services.foo')).toEqual(true); | ||
expect(config.get('services.foo')()).toEqual(42); | ||
}); | ||
}); |
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