mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 18:11:36 +00:00
2eadf30199
* fix for TypeError: The "path" argument must be of type string in writeDevicesOrGroups
* added test case that produces the error when running on old implementation
Summary of all failing tests
FAIL test/settings.test.js
● Settings › Should add devices even when devices exist empty
TypeError: The "path" argument must be of type string. Received undefined
275 |
276 | jest.mock('../../lib/util/data', () => ({
> 277 | joinPath: (file) => require('path').join(mockDir, file),
| ^
278 | getPath: () => mockDir,
279 | }));
280 |
at Object.join [as joinPath] (test/stub/data.js:277:41)
at joinPath (lib/util/settings.ts:245:38)
at writeDevicesOrGroups (lib/util/settings.ts:250:5)
at Object.write [as addDevice] (lib/util/settings.ts:555:5)
at Object.addDevice (test/settings.test.js:128:18)