@@ -2,7 +2,7 @@ import { join, dirname } from 'path';
22import { cwd } from 'process' ;
33import { writeFileSync , existsSync , mkdirSync , rmdirSync } from 'fs' ;
44import f from 'faker' ;
5- import { Import } from '../src' ;
5+ import { ExportType , Import } from '../src' ;
66
77export const MOCKS_DIR = '__mocks__' ;
88export const MOCKS_DIR_CWD = join ( join ( cwd ( ) , MOCKS_DIR ) ) ;
@@ -48,6 +48,7 @@ function jsxElement(value: string, line: number): [Import, string] {
4848 return [
4949 {
5050 name : value ,
51+ type : ExportType . named ,
5152 usages : [
5253 {
5354 line : line + 2 ,
@@ -67,6 +68,7 @@ function propertyAccess(value: string, line: number): [Import, string] {
6768 return [
6869 {
6970 name : value ,
71+ type : ExportType . named ,
7072 usages : [ { line : line + 2 , property, text : `\n${ value } .${ property } ` } ] ,
7173 } ,
7274 `${ value } .${ property } ` ,
@@ -75,14 +77,22 @@ function propertyAccess(value: string, line: number): [Import, string] {
7577
7678function callExpression ( value : string , line : number ) : [ Import , string ] {
7779 return [
78- { name : value , usages : [ { line : line + 2 , text : `\n${ value } ()` } ] } ,
80+ {
81+ name : value ,
82+ type : ExportType . named ,
83+ usages : [ { line : line + 2 , text : `\n${ value } ()` } ] ,
84+ } ,
7985 `${ value } ()` ,
8086 ] ;
8187}
8288
8389function valueUsage ( value : string , line : number ) : [ Import , string ] {
8490 return [
85- { name : value , usages : [ { line : line + 2 , text : `\n${ value } ;` } ] } ,
91+ {
92+ name : value ,
93+ type : ExportType . named ,
94+ usages : [ { line : line + 2 , text : `\n${ value } ;` } ] ,
95+ } ,
8696 `${ value } ;` ,
8797 ] ;
8898}
0 commit comments