@@ -2,12 +2,13 @@ import type { AuditBuildOptions, Finding, Module } from '../../packages/compat/s
2
2
import { httpAudit , type HTTPAuditOptions } from '../../packages/compat/src/http-audit' ;
3
3
import type { Import } from '../../packages/compat/src/module-visitor' ;
4
4
import { Audit } from '../../packages/compat/src/audit' ;
5
- import { explicitRelative } from '../../packages/shared-internals' ;
5
+ import { cleanUrl , explicitRelative } from '../../packages/shared-internals' ;
6
6
import { install as installCodeEqualityAssertions } from 'code-equality-assertions/qunit' ;
7
7
import { posix } from 'path' ;
8
8
import { distance } from 'fastest-levenshtein' ;
9
9
import { sortBy } from 'lodash' ;
10
10
import { getRewrittenLocation } from './rewritten-path' ;
11
+ import { Memoize } from 'typescript-memoize' ;
11
12
12
13
export { Import } ;
13
14
@@ -113,8 +114,14 @@ export class ExpectAuditResults {
113
114
export class ExpectModule {
114
115
constructor ( private expectAudit : ExpectAuditResults , private inputName : string ) { }
115
116
117
+ @Memoize ( )
116
118
private get module ( ) {
117
119
let outputName = this . expectAudit . toRewrittenPath ( this . inputName ) ;
120
+ for ( let [ key , value ] of Object . entries ( this . expectAudit . result . modules ) ) {
121
+ if ( cleanUrl ( key ) === outputName ) {
122
+ return value ;
123
+ }
124
+ }
118
125
return this . expectAudit . result . modules [ outputName ] ;
119
126
}
120
127
@@ -264,7 +271,15 @@ export class ExpectModule {
264
271
this . emitMissingModule ( ) ;
265
272
return ;
266
273
}
267
- this . expectAudit . assert . deepEqual ( this . module . consumedFrom , paths . map ( this . expectAudit . toRewrittenPath ) ) ;
274
+
275
+ let consumedFrom = this . module . consumedFrom . map ( m => {
276
+ if ( typeof m === 'string' ) {
277
+ return cleanUrl ( m ) ;
278
+ }
279
+ return m ;
280
+ } ) ;
281
+
282
+ this . expectAudit . assert . deepEqual ( consumedFrom , paths . map ( this . expectAudit . toRewrittenPath ) ) ;
268
283
}
269
284
}
270
285
0 commit comments