diff --git a/docs/dgeni-package/processors/readTypeScriptModules.js b/docs/dgeni-package/processors/readTypeScriptModules.js index 6e68c28001..8e1a68f86e 100644 --- a/docs/dgeni-package/processors/readTypeScriptModules.js +++ b/docs/dgeni-package/processors/readTypeScriptModules.js @@ -24,8 +24,8 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo basePath: '.', // We can ignore members of classes that are private hidePrivateMembers: true, - // We can sort class members alphabetically - sortClassMembers: true, + // We leave class members sorted in order of declaration + sortClassMembers: false, // We can provide a collection of strings or regexes to ignore exports whose export names match ignoreExportsMatching: ['___esModule'], diff --git a/docs/dgeni-package/processors/readTypeScriptModules.spec.js b/docs/dgeni-package/processors/readTypeScriptModules.spec.js index 2c8ac217cf..f8208d53b8 100644 --- a/docs/dgeni-package/processors/readTypeScriptModules.spec.js +++ b/docs/dgeni-package/processors/readTypeScriptModules.spec.js @@ -46,16 +46,16 @@ describe('readTypeScriptModules', function() { describe('ordering of members', function() { - it('should order class members alphabetically (by default)', function() { + it('should order class members in order of appearance (by default)', function() { processor.sourceFiles = ['orderingOfMembers.ts']; var docs = []; processor.$process(docs); var classDoc = _.find(docs, { docType: 'class' }); expect(classDoc.docType).toEqual('class'); expect(getNames(classDoc.members)).toEqual([ - 'doStuff', 'firstItem', - 'otherMethod' + 'otherMethod', + 'doStuff', ]); });