mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 14:01:20 +00:00
fix(ignore): Ensure config example is never out of sync with settings (#25707)
This commit is contained in:
1 parent
31bdf02a72
commit
23b709cee2
1 file changed
+31
@@ -52,6 +52,37 @@ describe('Settings', () => {
|
||||
clearEnvironmentVariables();
|
||||
});
|
||||
|
||||
it('Ensures configuration.example.yaml is never out of sync with settings', () => {
|
||||
let path = './data/configuration.example.yaml';
|
||||
|
||||
// allow running in single-test mode
|
||||
if (!fs.existsSync('./data')) {
|
||||
path = '../data/configuration.example.yaml';
|
||||
}
|
||||
|
||||
const exampleYaml = read(path) as Record<string, unknown>;
|
||||
|
||||
// force keeping an eye on example yaml whenever CURRENT_VERSION changes
|
||||
expect(exampleYaml).toStrictEqual({
|
||||
version: settings.CURRENT_VERSION,
|
||||
homeassistant: {
|
||||
enabled: false,
|
||||
},
|
||||
frontend: {
|
||||
enabled: true,
|
||||
},
|
||||
mqtt: {
|
||||
base_topic: 'zigbee2mqtt',
|
||||
server: 'mqtt://localhost',
|
||||
},
|
||||
advanced: {
|
||||
network_key: 'GENERATE',
|
||||
pan_id: 'GENERATE',
|
||||
ext_pan_id: 'GENERATE',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('Should return default settings', () => {
|
||||
write(configurationFile, {});
|
||||
const s = settings.get();
|
||||
|
||||
Reference in new issue
Block a user