e2e-test: add versionQuery template helper
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -127,6 +127,16 @@ async function buildDistWorkspace(workspaceName: string, rootDir: string) {
|
||||
}
|
||||
return pkge.version;
|
||||
},
|
||||
versionQuery(name: string, hint: string) {
|
||||
const pkgData = require(`${name}/package.json`);
|
||||
if (!pkgData) {
|
||||
if (typeof hint !== 'string') {
|
||||
throw new Error(`No version available for package ${name}`);
|
||||
}
|
||||
return `^${hint}`;
|
||||
}
|
||||
return `^${pkgData.version}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user