@@ -156,6 +156,19 @@ for (const [name, testPrepare] of Object.entries(testMethods)) {
156
156
t . strictSame ( content . bin , { echo : 'bin/echo' } )
157
157
} )
158
158
159
+ t . test ( 'bin handles hidden folders' , async t => {
160
+ const { content } = await testPrepare ( t , ( {
161
+ 'package.json' : JSON . stringify ( {
162
+ name : 'bin-test' ,
163
+ bin : {
164
+ echo : '..\\..\\..\\.bin\\echo' ,
165
+ } ,
166
+ } ) ,
167
+ bin : { echo : '#!/bin/sh\n\necho "hello world"' } ,
168
+ } ) )
169
+ t . strictSame ( content . bin , { echo : '.bin/echo' } )
170
+ } )
171
+
159
172
t . test ( 'directories.bin with bin' , async t => {
160
173
const { content } = await testPrepare ( t , ( {
161
174
'package.json' : JSON . stringify ( {
@@ -175,6 +188,25 @@ for (const [name, testPrepare] of Object.entries(testMethods)) {
175
188
t . strictSame ( content . bin , { echo : 'bin/echo' } )
176
189
} )
177
190
191
+ t . test ( 'directories.bin with hidden bin dir' , async t => {
192
+ const { content } = await testPrepare ( t , ( {
193
+ 'package.json' : JSON . stringify ( {
194
+ name : 'bin-test' ,
195
+ directories : {
196
+ bin : './.bin' ,
197
+ } ,
198
+ bin : {
199
+ echo : './.bin/echo' ,
200
+ } ,
201
+ } ) ,
202
+ bin : {
203
+ echo : '#!/bin/sh\n\necho "hello world"' ,
204
+ echo2 : '#!/bin/sh\n\necho "hello world2"' ,
205
+ } ,
206
+ } ) )
207
+ t . strictSame ( content . bin , { echo : '.bin/echo' } )
208
+ } )
209
+
178
210
t . end ( )
179
211
} )
180
212
@@ -189,6 +221,16 @@ for (const [name, testPrepare] of Object.entries(testMethods)) {
189
221
t . strictSame ( content . man , [ 'man/man1/test.1' ] )
190
222
} )
191
223
224
+ t . test ( 'resolves hidden directory' , async t => {
225
+ const { content } = await testPrepare ( t , ( {
226
+ 'package.json' : JSON . stringify ( {
227
+ directories : { man : './.man' } ,
228
+ } ) ,
229
+ '.man' : { man1 : { 'test.1' : 'man test file' } } ,
230
+ } ) )
231
+ t . strictSame ( content . man , [ '.man/man1/test.1' ] )
232
+ } )
233
+
192
234
if ( name === '@npmcli/package-json' ) {
193
235
t . test ( 'non-string' , async t => {
194
236
const { content } = await testPrepare ( t , ( {
0 commit comments