mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-19 18:28:42 +00:00
Fix eslint import extension (#682)
* Fix eslint import extension * Update eslint hound * Enable no unresolved for normal usage
This commit is contained in:
@@ -3,10 +3,10 @@ import computeDomain from '../../../js/common/util/compute_domain';
|
||||
const assert = require('assert');
|
||||
|
||||
describe('computeDomain', () => {
|
||||
it('Detects sensor domain', () => {
|
||||
const stateObj = {
|
||||
entity_id: 'sensor.test',
|
||||
};
|
||||
assert.strictEqual(computeDomain(stateObj), 'sensor');
|
||||
it('Returns domains', () => {
|
||||
assert.equal(computeDomain('sensor.bla'), 'sensor');
|
||||
assert.equal(computeDomain('switch.bla'), 'switch');
|
||||
assert.equal(computeDomain('light.bla'), 'light');
|
||||
assert.equal(computeDomain('persistent_notification.bla'), 'persistent_notification');
|
||||
});
|
||||
});
|
||||
|
||||
12
test-mocha/common/util/compute_state_domain.js
Normal file
12
test-mocha/common/util/compute_state_domain.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import computeStateDomain from '../../../js/common/util/compute_state_domain.js';
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
describe('computeStateDomain', () => {
|
||||
it('Detects sensor domain', () => {
|
||||
const stateObj = {
|
||||
entity_id: 'sensor.test',
|
||||
};
|
||||
assert.strictEqual(computeStateDomain(stateObj), 'sensor');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user