I have a function
export function getFileContent(path: string): any {
const content = readFileSync(path);
return JSON.parse(content.toString());
}
If I want to check if the expression getFileContent(meteFile) throws some definite error I should write something like
expect(getFileContent(meteFile)).to.throw(new SyntaxError('Unexpected token } in JSON at position 82'));
But is there a way to check if the expression doesn't raise any error?
I tried this
expect(getFileContent(metaFile)).not.to.throw();
But got the error
AssertionError: expected { Object (...) } to be a function
So how can I check if the function call doesn't throw any error?