Add regression test for #38834 (#39479)

This commit is contained in:
Wesley Wigham 2020-07-08 13:32:15 -07:00 committed by GitHub
parent 0f86c04af3
commit dd2b2447d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,26 @@
//// [index.js]
export const colors = {
royalBlue: "#6400e4",
};
export const brandColors = {
purple: colors.royalBlue,
};
//// [index.js]
export const colors = {
royalBlue: "#6400e4",
};
export const brandColors = {
purple: colors.royalBlue,
};
//// [index.d.ts]
export namespace colors {
const royalBlue: string;
}
export namespace brandColors {
import purple = colors.royalBlue;
export { purple };
}

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/jsdoc/declarations/index.js ===
export const colors = {
>colors : Symbol(colors, Decl(index.js, 0, 12))
royalBlue: "#6400e4",
>royalBlue : Symbol(royalBlue, Decl(index.js, 0, 23))
};
export const brandColors = {
>brandColors : Symbol(brandColors, Decl(index.js, 4, 12))
purple: colors.royalBlue,
>purple : Symbol(purple, Decl(index.js, 4, 28))
>colors.royalBlue : Symbol(royalBlue, Decl(index.js, 0, 23))
>colors : Symbol(colors, Decl(index.js, 0, 12))
>royalBlue : Symbol(royalBlue, Decl(index.js, 0, 23))
};

View file

@ -0,0 +1,22 @@
=== tests/cases/conformance/jsdoc/declarations/index.js ===
export const colors = {
>colors : { royalBlue: string; }
>{ royalBlue: "#6400e4",} : { royalBlue: string; }
royalBlue: "#6400e4",
>royalBlue : string
>"#6400e4" : "#6400e4"
};
export const brandColors = {
>brandColors : { purple: string; }
>{ purple: colors.royalBlue,} : { purple: string; }
purple: colors.royalBlue,
>purple : string
>colors.royalBlue : string
>colors : { royalBlue: string; }
>royalBlue : string
};

View file

@ -0,0 +1,13 @@
// @allowJs: true
// @checkJs: true
// @outDir: ./out
// @target: es6
// @declaration: true
// @filename: index.js
export const colors = {
royalBlue: "#6400e4",
};
export const brandColors = {
purple: colors.royalBlue,
};