fix: Pick up credential test functions from versioned nodes as well (#4962)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-12-19 15:12:04 +01:00 committed by GitHub
parent bfc8e68b37
commit 2797c085e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,13 +29,14 @@ const generate = async (kind) => {
.sync(`dist/${kind}/**/*.${kind === 'nodes' ? 'node' : kind}.js`, { .sync(`dist/${kind}/**/*.${kind === 'nodes' ? 'node' : kind}.js`, {
cwd: packageDir, cwd: packageDir,
}) })
.filter((filePath) => !/[vV]\d.node\.js$/.test(filePath))
.map(loadClass) .map(loadClass)
.filter((data) => !!data) .filter((data) => !!data)
.reduce((obj, { className, sourcePath, instance }) => { .reduce((obj, { className, sourcePath, instance }) => {
const name = kind === 'nodes' ? instance.description.name : instance.name; const name = kind === 'nodes' ? instance.description.name : instance.name;
if (name in obj) console.error('already loaded', kind, name, sourcePath); if (!/[vV]\d.node\.js$/.test(sourcePath)) {
else obj[name] = { className, sourcePath }; if (name in obj) console.error('already loaded', kind, name, sourcePath);
else obj[name] = { className, sourcePath };
}
if (kind === 'nodes') { if (kind === 'nodes') {
const { credentials } = instance.description; const { credentials } = instance.description;