Skip to content

Commit 1836018

Browse files
committed
[WIP]: feat: run tests
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
1 parent c2bc406 commit 1836018

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
@@ -50,7 +50,22 @@ module.exports = async function ({ dependents }) {
5050
}
5151

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

0 commit comments

Comments
 (0)