@@ -59,6 +59,12 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
59
59
assertResults ( nodeProcess . stdout ) ;
60
60
expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
61
61
} ) ;
62
+
63
+ test ( 'Import with query' , async ( ) => {
64
+ const nodeProcess = await node . import ( importPath + query , { typescript : true } ) ;
65
+ assertResults ( nodeProcess . stdout ) ;
66
+ expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
67
+ } ) ;
62
68
} ) ;
63
69
64
70
describe ( 'extensionless' , ( { test } ) => {
@@ -74,6 +80,12 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
74
80
assertResults ( nodeProcess . stdout ) ;
75
81
expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
76
82
} ) ;
83
+
84
+ test ( 'Import with query' , async ( ) => {
85
+ const nodeProcess = await node . import ( importPath + query , { typescript : true } ) ;
86
+ assertResults ( nodeProcess . stdout ) ;
87
+ expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
88
+ } ) ;
77
89
} ) ;
78
90
79
91
describe ( 'extensionless with subextension' , ( { test } ) => {
@@ -89,6 +101,12 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
89
101
assertResults ( nodeProcess . stdout , 'ts-ext-ts/index.tsx.ts' ) ;
90
102
expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
91
103
} ) ;
104
+
105
+ test ( 'Import with query' , async ( ) => {
106
+ const nodeProcess = await node . import ( importPath + query ) ;
107
+ assertResults ( nodeProcess . stdout , 'ts-ext-ts/index.tsx.ts' ) ;
108
+ expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
109
+ } ) ;
92
110
} ) ;
93
111
94
112
describe ( 'directory' , ( { test } ) => {
@@ -104,6 +122,12 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
104
122
assertResults ( nodeProcess . stdout ) ;
105
123
expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
106
124
} ) ;
125
+
126
+ test ( 'Import with query' , async ( ) => {
127
+ const nodeProcess = await node . import ( importPath + query ) ;
128
+ assertResults ( nodeProcess . stdout ) ;
129
+ expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
130
+ } ) ;
107
131
} ) ;
108
132
109
133
describe ( 'empty directory should fallback to file' , ( { test } ) => {
@@ -119,6 +143,12 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
119
143
assertResults ( nodeProcess . stdout ) ;
120
144
expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
121
145
} ) ;
146
+
147
+ test ( 'Import with query' , async ( ) => {
148
+ const nodeProcess = await node . import ( importPath + query ) ;
149
+ assertResults ( nodeProcess . stdout ) ;
150
+ expect ( nodeProcess . stdout ) . toMatch ( '{"default":1234}' ) ;
151
+ } ) ;
122
152
} ) ;
123
153
124
154
describe ( 'empty but explicit directory should not fallback to file' , ( { test } ) => {
@@ -128,6 +158,11 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
128
158
const nodeProcess = await node . import ( importPath ) ;
129
159
assertNotFound ( nodeProcess . stderr , importPath ) ;
130
160
} ) ;
161
+
162
+ test ( 'Import with query' , async ( ) => {
163
+ const nodeProcess = await node . import ( importPath + query ) ;
164
+ assertNotFound ( nodeProcess . stderr , importPath ) ;
165
+ } ) ;
131
166
} ) ;
132
167
} ) ;
133
168
} ) ;
0 commit comments