-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude homeassistant entries from null cleanup #22995
Conversation
updated to be less dirty. |
It seems the coverage fails, can you run |
Unfortunately too many tests timeout on my way too underpowered system :-/ I'll have to get a proper dev setup at some point |
Coverage likely isn't happy because nothing must be testing the function called without that second param -defaulting- (all occurrences in z2m code pass the param). it('Removes null properties from object', () => {
const obj1 = {
ab: 0,
cd: false,
ef: null,
gh: '',
homeassistant: {
xyz: 'mock',
abcd: null,
},
nested: {
homeassistant: {
abcd: true,
xyz: null,
},
abc: {},
def: null,
},
};
utils.removeNullPropertiesFromObject(obj1);
expect(obj1).toStrictEqual({
ab: 0,
cd: false,
gh: '',
homeassistant: {
xyz: 'mock',
},
nested: {
homeassistant: {
abcd: true,
},
abc: {}
},
});
const obj2 = {
ab: 0,
cd: false,
ef: null,
gh: '',
homeassistant: {
xyz: 'mock',
abcd: null,
},
nested: {
homeassistant: {
abcd: true,
xyz: null,
},
abc: {},
def: null,
},
};
utils.removeNullPropertiesFromObject(obj2, ['homeassistant']);
expect(obj2).toStrictEqual({
ab: 0,
cd: false,
gh: '',
homeassistant: {
xyz: 'mock',
abcd: null,
},
nested: {
homeassistant: {
abcd: true,
xyz: null,
},
abc: {}
},
});
}); |
341f0e3
to
8c606d5
Compare
Implemented @Nerivec suggestions, thanks! |
Something went wrong with your latest commit. |
8c606d5
to
d65a611
Compare
I messed up trying to rebase , not sure what went wrong... |
Thanks both! |
skip homeassistant keys from the null values cleanup
Quick and sligtly dirty fix for #22976