describe("sample", function(){ it("should return testdata", function(){ expect(testfunc()).toEqual('testdata'); }); it("checks that async / await works", async() => { function asyncFunctionSample(x) { return new Promise( resolve => { setTimeout(()=> {resolve(x);}, 3000); } ); } async function check(x) { var retval = asyncFunctionSample(10); return x + await retval; } var v = await check(10); expect(v).toBe(20); }); });