@@ -115,8 +115,87 @@ describe('yarn', () => {
115
115
it ( 'should return the original lockfile' , ( ) => {
116
116
const testContent = 'eugfogfoigqwoeifgoqwhhacvaisvciuviwefvc' ;
117
117
const testContent2 = 'eugfogfoigqwoeifgoqwhhacvaisvciuviwefvc' ;
118
- yarnModule . rebaseLockfile ( '.' , testContent ) ;
119
- expect ( testContent ) . to . equal ( testContent2 ) ;
118
+ expect ( yarnModule . rebaseLockfile ( '.' , testContent ) ) . to . equal ( testContent2 ) ;
119
+ } ) ;
120
+
121
+ it ( 'should rebase file references' , ( ) => {
122
+ const testContent = `
123
+ acorn@^2.1.0, acorn@^2.4.0:
124
+ version "2.7.0"
125
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7"
126
+
127
+ acorn@^3.0.4:
128
+ version "3.3.0"
129
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
130
+
131
+ otherModule@file:../../otherModule/the-new-version:
132
+ version "1.2.0"
133
+
134
+ acorn@^2.1.0, acorn@^2.4.0:
135
+ version "2.7.0"
136
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7"
137
+
138
+ "@myCompany/myModule@../../myModule/the-new-version":
139
+ version "6.1.0"
140
+ dependencies:
141
+ aws-xray-sdk "^1.1.6"
142
+ aws4 "^1.6.0"
143
+ base-x "^3.0.3"
144
+ bluebird "^3.5.1"
145
+ chalk "^1.1.3"
146
+ cls-bluebird "^2.1.0"
147
+ continuation-local-storage "^3.2.1"
148
+ lodash "^4.17.4"
149
+ moment "^2.20.0"
150
+ redis "^2.8.0"
151
+ request "^2.83.0"
152
+ ulid "^0.1.0"
153
+ uuid "^3.1.0"
154
+
155
+ acorn@^5.0.0, acorn@^5.5.0:
156
+ version "5.5.3"
157
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9"
158
+ ` ;
159
+
160
+ const expectedContent = `
161
+ acorn@^2.1.0, acorn@^2.4.0:
162
+ version "2.7.0"
163
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7"
164
+
165
+ acorn@^3.0.4:
166
+ version "3.3.0"
167
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
168
+
169
+ otherModule@file:../../project/../../otherModule/the-new-version:
170
+ version "1.2.0"
171
+
172
+ acorn@^2.1.0, acorn@^2.4.0:
173
+ version "2.7.0"
174
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7"
175
+
176
+ "@myCompany/myModule@../../project/../../myModule/the-new-version":
177
+ version "6.1.0"
178
+ dependencies:
179
+ aws-xray-sdk "^1.1.6"
180
+ aws4 "^1.6.0"
181
+ base-x "^3.0.3"
182
+ bluebird "^3.5.1"
183
+ chalk "^1.1.3"
184
+ cls-bluebird "^2.1.0"
185
+ continuation-local-storage "^3.2.1"
186
+ lodash "^4.17.4"
187
+ moment "^2.20.0"
188
+ redis "^2.8.0"
189
+ request "^2.83.0"
190
+ ulid "^0.1.0"
191
+ uuid "^3.1.0"
192
+
193
+ acorn@^5.0.0, acorn@^5.5.0:
194
+ version "5.5.3"
195
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9"
196
+ ` ;
197
+
198
+ expect ( yarnModule . rebaseLockfile ( '../../project' , testContent ) ) . to . equal ( expectedContent ) ;
120
199
} ) ;
121
200
} ) ;
122
201
0 commit comments