Skip to content

Commit a0df305

Browse files
committed
[WIP]: feat: run tests
Signed-off-by: Sebastian Beltran <[email protected]>
1 parent f69cd4c commit a0df305

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,22 @@ module.exports = async function ({ dependents }) {
4848
}
4949

5050
debug(`Cloning dependent repository ${url} into ${tmpDir}`)
51+
5152
await exec('git', ['clone', '--depth=1', url, tmpDir])
53+
54+
debug(`Changing directory to ${tmpDir}`)
55+
process.chdir(tmpDir)
56+
57+
debug(`Installing package from ${parentPkgJSON.name}-${parentPkgJSON.version}.tgz`)
58+
await exec('npm', ['install', `${parentPkgJSON.name}-${parentPkgJSON.version}.tgz`])
59+
60+
try {
61+
debug('Running tests')
62+
63+
await exec('npm', ['run', 'test'])
64+
} catch (error) {
65+
// catch the error and report it
66+
}
5267
} else {
5368
const dependentPkgJson = await github.getPackageJson(dependentRepositoryInfo.owner, dependentRepositoryInfo.name, sha)
5469
debug(`Dependent module: ${dependentRepositoryInfo.owner}/${dependentRepositoryInfo.name}, sha ${sha}`)

0 commit comments

Comments
 (0)