I have an async function that depends on another async function and i'm testing if it'll throw an error when the url is wrong, it does throw the error and it is on the console.
But the test keeps failing, however I write the syntax. I'm completely lost at how I'm supposed to write this and I've wasted too many hours on this crap...
expect(GetSecret('', 'test-secret')).to.eventually.throw(
'TypeError: Only absolute URLs are supported',
);
expect(GetSecret('', 'test-secret')).to.eventually.throw;
expect(GetSecret('', 'test-secret')).to.eventually.be.rejected;
These are a few ways I've tried them out but the same result every single time.
I've also tried to await GetSecret(''
... in every possible combination with these, but nonetheless, same result.
My versions:
"@types/mocha": "^5.2.7",
"@types/chai-as-promised": "^7.1.2",
"chai": "2.1.2",
"chai-as-promised": "^7.1.1",
Then importing:
import { expect } from 'chai';