You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Invalid version provided to the --packages flag. Package mylib@NOT_SEMVER is missing version. Please try: "@[scope]/[package]@[version]" for example @mylib/avatar@10.0.0',
285
+
'Invalid version provided to the --packages flag. Unable to resolve version "NOT_SEMVER" for package "mylib". Please try: "[scope]/[package]@[version]" for example @mylib/mypackage@10.0.0',
286
+
);
287
+
}
288
+
});
289
+
290
+
it('should throw when transform is not found',async()=>{
291
+
expect.assertions(1);
292
+
293
+
try{
294
+
awaitmain([mockPath],{
295
+
packages: 'mylib@120.0.0',
296
+
parser: 'babel',
297
+
extensions: 'js',
298
+
});
299
+
}catch(error){
300
+
// @ts-ignore
301
+
expect(error.message).toMatch(
302
+
'Invalid version provided to the --packages flag. Unable to resolve version "120.0.0" for package "mylib"',
274
303
);
275
304
}
276
305
});
@@ -299,4 +328,93 @@ describe('main', () => {
299
328
);
300
329
});
301
330
});
331
+
332
+
describe('when running presets with the -p flag',()=>{
`Invalid version provided to the --packages flag. Package ${pkg} is missing version. Please try: "@[scope]/[package]@[version]" for example @mylib/avatar@10.0.0`,
`Invalid version provided to the --packages flag. Unable to resolve version "${id}" for package "${pkgName}". Please try: "[scope]/[package]@[version]" for example @mylib/mypackage@10.0.0`,
65
+
);
66
+
}
67
+
68
+
if(!codeshiftConfig.transforms[id]){
69
+
thrownewInvalidUserInputError(
70
+
`Invalid version provided to the --packages flag. Unable to resolve version "${id}" for package "${pkgName}"`,
71
+
);
72
+
}
73
+
});
74
+
75
+
presetIds.forEach(id=>{
76
+
if(!codeshiftConfig.presets[id]){
77
+
thrownewInvalidUserInputError(
78
+
`Invalid preset provided to the --packages flag. Unable to resolve preset "${id}" for package "${pkgName}""`,
0 commit comments