Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

chai async test

const chai = require('chai');
const expect = chai.expect;
chai.use(require('chai-as-promised'));

async function methodToFail() {
	throw new Error("Failed");
}

await expect(methodToFail()).to.be.rejectedWith("Failed");
 
PREVIOUS NEXT
Tagged: #chai #async #test
ADD COMMENT
Topic
Name
8+9 =