test: Remove unnecessary jsdom environment declarations (#2616)
This commit is contained in:
@@ -3,7 +3,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('and condition', () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
||||
import { callConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/call';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('call condition', () => {
|
||||
it('should require a value', () => {
|
||||
expect(() => callConditionSchema.parse({ condition: 'call' })).toThrow();
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('camera condition', () => {
|
||||
it('should match a named camera', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('display mode condition', () => {
|
||||
it('should match a display mode condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
||||
import { expandConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/expand';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('expand condition', () => {
|
||||
it('should match an expand condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
||||
import { fullscreenConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/fullscreen';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('fullscreen condition', () => {
|
||||
it('should match a fullscreen condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('initialized condition', () => {
|
||||
it('should match an initialized condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
||||
import { interactionConditionSchema } from '../../../../src/config/schema/condition-trigger/conditions/custom/interaction';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('interaction condition', () => {
|
||||
it('should match an interaction condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('key condition', () => {
|
||||
it('should match a simple keypress', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -5,7 +5,6 @@ import { mediaLoadedConditionSchema } from '../../../../src/config/schema/condit
|
||||
import { createMediaLoadedInfo } from '../../../test-utils';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('media loaded condition', () => {
|
||||
it('should match a media loaded condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -4,7 +4,6 @@ import type { MicrophoneState } from '../../../../src/card-controller/types';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('microphone condition', () => {
|
||||
const createMicrophoneState = (state: Partial<MicrophoneState>): MicrophoneState => {
|
||||
return {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('not condition', () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
|
||||
@@ -3,7 +3,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('or condition', () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('triggered condition', () => {
|
||||
it('should match any triggered camera when no list is given', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('user agent condition', () => {
|
||||
const userAgent =
|
||||
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createConditionEvaluator } from '../../../../src/condition-trigger/cond
|
||||
import { createHASS, createUser } from '../../../test-utils';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('user condition', () => {
|
||||
it('should match a user condition', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
@@ -3,7 +3,6 @@ import { describe, expect, it } from 'vitest';
|
||||
import { createConditionEvaluator } from '../../../../src/condition-trigger/conditions/factory';
|
||||
import { createEvaluatorContext } from './test-utils';
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('view condition', () => {
|
||||
it('should match a named view', () => {
|
||||
const evaluator = createConditionEvaluator(
|
||||
|
||||
Reference in New Issue
Block a user