@@ -22,8 +22,8 @@ module.exports = (makeTemporaryEnv: PackageDriver) => {
22
22
await writeFile (
23
23
`${ path } /packages/workspace-a/index.js` ,
24
24
`
25
- module.exports = 42;
26
- ` ,
25
+ module.exports = 42;
26
+ ` ,
27
27
) ;
28
28
29
29
await run ( `install` ) ;
@@ -56,8 +56,8 @@ module.exports = (makeTemporaryEnv: PackageDriver) => {
56
56
await writeFile (
57
57
`${ path } /packages/workspace-a/index.js` ,
58
58
`
59
- module.exports = require('workspace-b/package.json');
60
- ` ,
59
+ module.exports = require('workspace-b/package.json');
60
+ ` ,
61
61
) ;
62
62
63
63
await writeJson ( `${ path } /packages/workspace-b/package.json` , {
@@ -71,8 +71,8 @@ module.exports = (makeTemporaryEnv: PackageDriver) => {
71
71
await writeFile (
72
72
`${ path } /packages/workspace-b/index.js` ,
73
73
`
74
- module.exports = require('workspace-a/package.json');
75
- ` ,
74
+ module.exports = require('workspace-a/package.json');
75
+ ` ,
76
76
) ;
77
77
78
78
await run ( `install` ) ;
@@ -110,8 +110,8 @@ module.exports = (makeTemporaryEnv: PackageDriver) => {
110
110
await writeFile (
111
111
`${ path } /packages/workspace/index.js` ,
112
112
`
113
- module.exports = require('no-deps/package.json');
114
- ` ,
113
+ module.exports = require('no-deps/package.json');
114
+ ` ,
115
115
) ;
116
116
117
117
await writeJson ( `${ path } /packages/no-deps/package.json` , {
@@ -128,5 +128,32 @@ module.exports = (makeTemporaryEnv: PackageDriver) => {
128
128
} ,
129
129
) ,
130
130
) ;
131
+
132
+ test (
133
+ `it should allow scripts defined in workspaces to run successfully` ,
134
+ makeTemporaryEnv (
135
+ {
136
+ private : true ,
137
+ workspaces : [ `packages/*` ] ,
138
+ } ,
139
+ async ( { path, run, source} ) => {
140
+ await writeJson ( `${ path } /packages/workspace/package.json` , {
141
+ name : `workspace` ,
142
+ version : `1.0.0` ,
143
+ dependencies : {
144
+ [ `has-bin-entries` ] : `1.0.0` ,
145
+ } ,
146
+ } ) ;
147
+
148
+ await run ( `install` ) ;
149
+
150
+ await expect (
151
+ run ( `run` , `has-bin-entries` , `foo` , {
152
+ cwd : `${ path } /packages/workspace` ,
153
+ } ) ,
154
+ ) . resolves . toMatchObject ( { stdout : `foo\n` } ) ;
155
+ } ,
156
+ ) ,
157
+ ) ;
131
158
} ) ;
132
159
} ;
0 commit comments