mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 23:00:55 +00:00
chore: Implement prettier (#23153)
* chore: Implement prettier * Run prettier * fix lint * process feedback * process feedback
This commit is contained in:
+11
-11
@@ -7,25 +7,25 @@ describe('Utils', () => {
|
||||
it('Object has properties', () => {
|
||||
expect(utils.objectHasProperties({a: 1, b: 2, c: 3}, ['a', 'b'])).toBeTruthy();
|
||||
expect(utils.objectHasProperties({a: 1, b: 2, c: 3}, ['a', 'b', 'd'])).toBeFalsy();
|
||||
})
|
||||
});
|
||||
|
||||
it('git last commit', async () => {
|
||||
let mockReturnValue = [];
|
||||
jest.mock('git-last-commit', () => ({
|
||||
getLastCommit: (cb) => cb(mockReturnValue[0], mockReturnValue[1])
|
||||
getLastCommit: (cb) => cb(mockReturnValue[0], mockReturnValue[1]),
|
||||
}));
|
||||
|
||||
mockReturnValue = [false, {shortHash: '123'}]
|
||||
expect(await utils.getZigbee2MQTTVersion()).toStrictEqual({"commitHash": "123", "version": version});
|
||||
mockReturnValue = [false, {shortHash: '123'}];
|
||||
expect(await utils.getZigbee2MQTTVersion()).toStrictEqual({commitHash: '123', version: version});
|
||||
|
||||
mockReturnValue = [true, null]
|
||||
expect(await utils.getZigbee2MQTTVersion()).toStrictEqual({"commitHash": expect.any(String), "version": version});
|
||||
})
|
||||
mockReturnValue = [true, null];
|
||||
expect(await utils.getZigbee2MQTTVersion()).toStrictEqual({commitHash: expect.any(String), version: version});
|
||||
});
|
||||
|
||||
it('Check dependency version', async () => {
|
||||
expect(await utils.getDependencyVersion('zigbee-herdsman')).toStrictEqual({"version": versionHerdsman});
|
||||
expect(await utils.getDependencyVersion('zigbee-herdsman-converters')).toStrictEqual({"version": versionHerdsmanConverters});
|
||||
})
|
||||
expect(await utils.getDependencyVersion('zigbee-herdsman')).toStrictEqual({version: versionHerdsman});
|
||||
expect(await utils.getDependencyVersion('zigbee-herdsman-converters')).toStrictEqual({version: versionHerdsmanConverters});
|
||||
});
|
||||
|
||||
it('To local iso string', async () => {
|
||||
var date = new Date('August 19, 1975 23:15:30 UTC+00:00');
|
||||
@@ -35,7 +35,7 @@ describe('Utils', () => {
|
||||
Date.prototype.getTimezoneOffset = () => -60;
|
||||
expect(utils.formatDate(date, 'ISO_8601_local').endsWith('+01:00')).toBeTruthy();
|
||||
Date.prototype.getTimezoneOffset = getTimezoneOffset;
|
||||
})
|
||||
});
|
||||
it('Removes null properties from object', () => {
|
||||
const obj1 = {
|
||||
ab: 0,
|
||||
|
||||
Reference in New Issue
Block a user