Skip to content

Commit

Permalink
bugfix - install drivers in scope level before test in scope
Browse files Browse the repository at this point in the history
  • Loading branch information
GiladShoham committed Jun 26, 2017
1 parent 1bd3f2f commit a9a13f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [unreleased]

## [0.6.5-rc.1] - 2017-06-26
- bugfix - install drivers in scope level before test in scope
- bugfix - install drivers in scope level before build in scope
- bugfix - calling to old bind command during component e2e tests

Expand Down
32 changes: 19 additions & 13 deletions src/scope/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,12 @@ export default class Scope {
*/
installDrivers(driversNames: string[]) {
const path = this.getPath();
console.log(path);
return Promise.all(driversNames.map((driverName) => npmClient.install(driverName, { cwd: path })))
}

deleteNodeModulesDir(): Promise<*> {
return new Promise((resolve, reject) => {
const path = this.getPath() + '/node_modules';
console.log("removing node moduels");
fs.remove(path, (err) => {
if (err) return reject(err);
return resolve();
Expand Down Expand Up @@ -617,14 +615,22 @@ export default class Scope {

return this.loadComponent(bitId)
.then((component) => {
return component.runSpecs({
scope: this,
consumer,
environment,
save,
verbose,
isolated,
});
const driver = Driver.load(component.lang);
return this.installDrivers([driver.driverName()])
.then(() => {
return component.runSpecs({
scope: this,
consumer,
environment,
save,
verbose,
isolated,
});
})
.then((specsResults) => {
return this.deleteNodeModulesDir()
.then(() => specsResults)
});
});
}

Expand All @@ -644,9 +650,9 @@ export default class Scope {
const driver = Driver.load(component.lang);
return this.installDrivers([driver.driverName()])
.then(() => {
return component.build({ scope: this, environment, save, consumer, verbose })
.then(() => this.deleteNodeModulesDir());
}
return component.build({ scope: this, environment, save, consumer, verbose });
})
.then(() => this.deleteNodeModulesDir());
});
}

Expand Down

0 comments on commit a9a13f7

Please sign in to comment.