mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 10:28:33 -07:00
acbab01b7e
`chai` ELIMINATED
23 lines
768 B
JavaScript
23 lines
768 B
JavaScript
const data = require('../lib/util/data.js');
|
|
const path = require('path');
|
|
|
|
describe('Data', () => {
|
|
describe('Get path', () => {
|
|
it('Should return correct path', () => {
|
|
const expected = path.normalize(path.join(__dirname, '..', 'data'));
|
|
const actual = data.getPath();
|
|
expect(actual).toBe(expected);
|
|
});
|
|
|
|
it('Should return correct path when ZIGBEE2MQTT_DATA set', () => {
|
|
const expected = path.join('var', 'zigbee2mqtt');
|
|
process.env.ZIGBEE2MQTT_DATA = expected;
|
|
data._reload();
|
|
const actual = data.getPath();
|
|
expect(actual).toBe(expected);
|
|
delete process.env.ZIGBEE2MQTT_DATA;
|
|
data._reload();
|
|
});
|
|
});
|
|
});
|