mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
unit tests for let keyword (#477)
This commit is contained in:
parent
c8167b8d76
commit
abeb539a33
17
test/fixtures/letkeyword.js
vendored
Normal file
17
test/fixtures/letkeyword.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/*global define: true */
|
||||
define( [], function() {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* My example module.
|
||||
* @exports exampleModule
|
||||
*/
|
||||
let myModule = {
|
||||
/**
|
||||
* My example method.
|
||||
*/
|
||||
exampleMethod: function() {}
|
||||
};
|
||||
|
||||
return myModule;
|
||||
} );
|
||||
28
test/specs/documentation/letkeyword.js
Normal file
28
test/specs/documentation/letkeyword.js
Normal file
@ -0,0 +1,28 @@
|
||||
/*global describe: true, expect: true, it: true, jasmine: true */
|
||||
describe('let keyword', function() {
|
||||
var docSet;
|
||||
var exampleModule;
|
||||
var exampleMethod;
|
||||
|
||||
function getDocSet() {
|
||||
docSet = jasmine.getDocSetFromFile('test/fixtures/letkeyword.js');
|
||||
exampleModule = docSet.getByLongname('module:exampleModule');
|
||||
exampleMethod = docSet.getByLongname('module:exampleModule.exampleMethod');
|
||||
}
|
||||
|
||||
it('should be able to compile JS files that contain the "let" keyword', function() {
|
||||
expect(getDocSet).not.toThrow();
|
||||
});
|
||||
|
||||
it('should correctly recognize a module defined with the "let" keyword', function() {
|
||||
expect(exampleModule).toBeDefined();
|
||||
expect( Array.isArray(exampleModule) ).toBe(true);
|
||||
expect(exampleModule.length).toBe(1);
|
||||
});
|
||||
|
||||
it('should correctly recognize members of a module defined with the "let" keyword', function() {
|
||||
expect(exampleMethod).toBeDefined();
|
||||
expect( Array.isArray(exampleMethod) ).toBe(true);
|
||||
expect(exampleMethod.length).toBe(1);
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user