jsdoc/test/specs/documentation/asyncfunction.js
Jeff Williams aa0b6c1bfa switch to new-ish ECMAScript syntax
With help from Lebab, plus a lot of manual cleanup. (And more cleanup to come, I'm sure.)
2019-01-15 18:39:10 -08:00

19 lines
666 B
JavaScript

describe('async functions', () => {
const docSet = jasmine.getDocSetFromFile('test/fixtures/asyncfunction.js');
const add = docSet.getByLongname('add')[0];
const subtract = docSet.getByLongname('subtract')[0];
const adderAdd = docSet.getByLongname('Adder#add')[0];
it('should automatically document async functions as async', () => {
expect(add.async).toBe(true);
});
it('should work when the async function is assigned to a variable', () => {
expect(subtract.async).toBe(true);
});
it('should work when the async function is a method definition', () => {
expect(adderAdd.async).toBe(true);
});
});