hello, i wanted to test my code with this tool AND...
it seems that it has issues with types...
code:
import { describe, expect, it } from 'vitest';
import { basketballParser } from '../parsers/basketballParser';
describe('Basketball Parser',()=>{
it('should output properly parsed data for Basketball',()=>{
const basketObject = basketballParser({
sport: 'basketball',
participant1: 'GKS Tychy',
participant2: 'GKS Katowice',
score: [
['9:7', '2:1'],
['5:3', '9:9']
],
})
})
});
the errors:
Type '"basketball"' is not assignable to type 'sportsEnum'.
Property 'score' is missing in type 'string[][]' but required in type 'Score'.
types he is talking about:
export declare interface Score {
score: string | string[][]
}
export declare interface EventInterface {
sport: sportsEnum,
participant1: string,
participant2: string,
score: Score
}
and the enum:
export enum sportsEnum {
volleyball = 'volleyball',
basketball = 'basketball',
handball = 'handball',
tennis = 'tennis',
soccer = 'soccer',
}
I literary pass proper data to the function, but he is complaining for some reason, any ideas why?