@@ -76,4 +76,66 @@ describe('fixReferences', () => {
76
76
77
77
expect ( result ) . toBe ( `export const two = 2;` ) ;
78
78
} ) ;
79
+
80
+ describe ( 'https://github.com/machty/ember-concurrency/issues/564' , ( ) => {
81
+ test ( 'declarations/helpers/cancel-all.d.ts' , ( ) => {
82
+ let code = stripIndent `
83
+ /// <reference types="ember-source/types/preview/@ember/component/-private/signature-utils" />
84
+ /// <reference types="ember-source/types/preview/@ember/component/helper" />
85
+ import type { Task } from '../index';
86
+ type CancelAllParams = [task: Task<any, any[]>];
87
+ export declare function cancelHelper(args: CancelAllParams): (...innerArgs: any[]) => any;
88
+ declare const _default: import("@ember/component/helper").FunctionBasedHelper<{
89
+ Args: {
90
+ Positional: CancelAllParams;
91
+ Named: import("@ember/component/helper").EmptyObject;
92
+ };
93
+ Return: (...innerArgs: any[]) => any;
94
+ }>;
95
+ export default _default;
96
+ ` ;
97
+
98
+ let result = fixReferences ( code ) ;
99
+
100
+ expect ( result ) . toMatchInlineSnapshot ( `
101
+ "import type { Task } from '../index';
102
+ type CancelAllParams = [task: Task<any, any[]>];
103
+ export declare function cancelHelper(args: CancelAllParams): (...innerArgs: any[]) => any;
104
+ declare const _default: import("@ember/component/helper").FunctionBasedHelper<{
105
+ Args: {
106
+ Positional: CancelAllParams;
107
+ Named: import("@ember/component/helper").EmptyObject;
108
+ };
109
+ Return: (...innerArgs: any[]) => any;
110
+ }>;
111
+ export default _default;"
112
+ ` ) ;
113
+ } ) ;
114
+
115
+ test ( 'declarations/-private/ember-environment.d.ts' , ( ) => {
116
+ let code = stripIndent `
117
+ export declare class EmberEnvironment extends Environment {
118
+ assert(...args: any[]): void;
119
+ reportUncaughtRejection(error: any): void;
120
+ defer(): any;
121
+ globalDebuggingEnabled(): any;
122
+ }
123
+ export declare const EMBER_ENVIRONMENT: EmberEnvironment;
124
+ import { Environment } from './external/environment';
125
+ ` ;
126
+
127
+ let result = fixReferences ( code ) ;
128
+
129
+ expect ( result ) . toMatchInlineSnapshot ( `
130
+ "export declare class EmberEnvironment extends Environment {
131
+ assert(...args: any[]): void;
132
+ reportUncaughtRejection(error: any): void;
133
+ defer(): any;
134
+ globalDebuggingEnabled(): any;
135
+ }
136
+ export declare const EMBER_ENVIRONMENT: EmberEnvironment;
137
+ import { Environment } from './external/environment';"
138
+ ` ) ;
139
+ } ) ;
140
+ } ) ;
79
141
} ) ;
0 commit comments