Typing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { safePath, timedExecution } from '$lib';
|
||||
import safePath, { timedExecution } from '$lib';
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
describe('safe path', () => {
|
||||
@@ -32,8 +32,8 @@ describe('safe path', () => {
|
||||
});
|
||||
|
||||
describe('timedExecution', () => {
|
||||
const asyncIdentity = async (v) => v;
|
||||
const identity = (v) => v;
|
||||
const asyncIdentity = async <T>(v: T): Promise<T> => v;
|
||||
const identity = <T>(v: T): T => v;
|
||||
|
||||
it('works with async', async () => {
|
||||
const { executionTime, result } = await timedExecution(() => asyncIdentity(5));
|
||||
|
Reference in New Issue
Block a user