* fix(typescript): add failing ambient declaration test * fix(typescript): fix failing test case for ambient function exportsmaster
parent
7e60d70f97
commit
a005211c96
|
@ -3165,7 +3165,8 @@ function printExportDeclaration(path, options, print) {
|
|||
decl.type === "ExportDefaultDeclaration" &&
|
||||
(decl.declaration.type !== "ClassDeclaration" &&
|
||||
decl.declaration.type !== "FunctionDeclaration" &&
|
||||
decl.declaration.type !== "TSAbstractClassDeclaration")
|
||||
decl.declaration.type !== "TSAbstractClassDeclaration" &&
|
||||
decl.declaration.type !== "TSNamespaceFunctionDeclaration")
|
||||
) {
|
||||
parts.push(semi);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`ambient.ts 1`] = `
|
||||
declare module "classnames" {
|
||||
export default function classnames(...inputs: (string | number | false | object | undefined)[]): string;
|
||||
export class x {}
|
||||
export interface y {}
|
||||
export type z = y;
|
||||
}
|
||||
|
||||
declare module "x" {
|
||||
export default class x {}
|
||||
}
|
||||
|
||||
declare module "y" {
|
||||
const y = 5;
|
||||
export default y;
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
declare module "classnames" {
|
||||
export default function classnames(
|
||||
...inputs: (string | number | false | object | undefined)[]
|
||||
): string;
|
||||
export class x {}
|
||||
export interface y {}
|
||||
export type z = y;
|
||||
}
|
||||
|
||||
declare module "x" {
|
||||
export default class x {}
|
||||
}
|
||||
|
||||
declare module "y" {
|
||||
const y = 5;
|
||||
export default y;
|
||||
}
|
||||
|
||||
`;
|
|
@ -0,0 +1,15 @@
|
|||
declare module "classnames" {
|
||||
export default function classnames(...inputs: (string | number | false | object | undefined)[]): string;
|
||||
export class x {}
|
||||
export interface y {}
|
||||
export type z = y;
|
||||
}
|
||||
|
||||
declare module "x" {
|
||||
export default class x {}
|
||||
}
|
||||
|
||||
declare module "y" {
|
||||
const y = 5;
|
||||
export default y;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname, { parser: "typescript" });
|
Loading…
Reference in New Issue