Merge branch 'master' into sync-dev

This commit is contained in:
Nick O'Leary
2024-06-11 10:14:01 +01:00
4 changed files with 34 additions and 10 deletions

View File

@@ -16,6 +16,31 @@ describe('Group', function () {
group.getSetting("NR_GROUP_NAME").should.equal("g1")
group.getSetting("NR_GROUP_ID").should.equal("group1")
})
it("returns cloned env var property", async function () {
const group = new Group({
getSetting: v => v+v
}, {
name: "g1",
id: "group1",
env: [
{
name: 'jsonEnvVar',
type: 'json',
value: '{"a":1}'
}
]
})
await group.start()
const result = group.getSetting('jsonEnvVar')
result.should.have.property('a', 1)
result.a = 2
result.b = 'hello'
const result2 = group.getSetting('jsonEnvVar')
result2.should.have.property('a', 1)
result2.should.not.have.property('b')
})
it("delegates to parent if not found", async function () {
const group = new Group({
getSetting: v => v+v