jsdoc/test/specs/documentation/asyncfunction.js
Jeff Williams 5f578e803b migrate from old, vendored Jasmine to jasmine package (#1602)
Plus some miscellaneous cleanup.
2019-01-21 19:38:07 -08:00

20 lines
683 B
JavaScript

/* global jsdoc */
describe('async functions', () => {
const docSet = jsdoc.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);
});
});