Skip to content

Commit

Permalink
Remove type tests for domain or scope in source
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrHoroshih committed Nov 18, 2023
1 parent 560e3f6 commit 8c7a1f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
18 changes: 0 additions & 18 deletions test-typings/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,6 @@ import { debounce } from '../src/debounce';
);
}

// Scope and Domain are not allowed in source
{
const target = createEvent<any>();

const domain = createDomain();
const scope = fork();

// @ts-expect-error
debounce({ source: domain, timeout: 0 });
// @ts-expect-error
debounce({ source: scope, timeout: 0 });

// @ts-expect-error
debounce({ source: domain, timeout: 0, target });
// @ts-expect-error
debounce({ source: scope, timeout: 0, target });
}

// Scope and Domain are not allowed in target
{
const source = createEvent<number>();
Expand Down
18 changes: 0 additions & 18 deletions test-typings/once.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@ import { once } from '../src/once';
expectType<Event<string>>(once({ source: createStore<string>('') }));
}

// Does not allow scope or domain as source or reset
{
// @ts-expect-error
once(createDomain());
// @ts-expect-error
once(fork());

// @ts-expect-error
once({ source: createDomain() });
// @ts-expect-error
once({ source: fork() });

// @ts-expect-error
once({ source: createEvent(), reset: createDomain() });
// @ts-expect-error
once({ source: createEvent(), reset: fork() });
}

// Correctly passes through complex types
{
const source = createEvent<'string' | false>();
Expand Down
2 changes: 0 additions & 2 deletions test-typings/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,4 @@ import { time } from '../src/time';

// @ts-expect-error
time({ clock: fn });
// @ts-expect-error
time({ clock: domain });
}

0 comments on commit 8c7a1f9

Please sign in to comment.