Skip to content

Commit c08db43

Browse files
test: ensure union types are sorted
1 parent 726a127 commit c08db43

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

lint-rules/validate-jsdoc-codeblocks.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,26 @@ ruleTester.run('validate-jsdoc-codeblocks', validateJSDocCodeblocksRule, {
805805
//=> '🦄' | '🐶' | '🐇'
806806
`))),
807807

808+
// Union symbols are sorted.
809+
exportTypeAndOption(jsdoc(fence(dedenter`
810+
namespace AAA {
811+
export type aaa = {a: string};
812+
}
813+
namespace BBB {
814+
export type aaa = {a: string};
815+
}
816+
namespace CCC {
817+
export type aaa = {a: string};
818+
export type bbb = {a: string};
819+
}
820+
821+
type Symbols_0 = AAA.aaa | CCC.bbb | CCC.aaa | BBB.aaa;
822+
//=> AAA.aaa | BBB.aaa | CCC.aaa | CCC.bbb
823+
824+
type Symbols_1 = AAA.aaa | CCC.bbb | CCC.aaa | BBB.aaa;
825+
//=> BBB.aaa | AAA.aaa | CCC.aaa | CCC.bbb
826+
`))),
827+
808828
// === Different types of quick info ===
809829
// Function
810830
exportTypeAndOption(jsdoc(fence(dedenter`

0 commit comments

Comments
 (0)