-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class TearDownCommand { | ||
constructor() { | ||
|
||
} | ||
|
||
run() { | ||
|
||
} | ||
} | ||
|
||
module.exports.TearDownCommand = TearDownCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict' | ||
|
||
let chai = require('chai'); | ||
let spies = require('chai-spies'); | ||
|
||
chai.use(spies); | ||
|
||
let should = chai.should(); | ||
let expect = chai.expect; | ||
|
||
let TearDownCommand = require('../src/TearDownCommand').TearDownCommand; | ||
|
||
describe('Tear down command tests', () => { | ||
it('should destroy all the objects in the dependency chain',() => { | ||
|
||
let accountDriverSpy = chai.spy.object(['tearDown']); | ||
let contactDriverSpy = chai.spy.object(['tearDown']); | ||
|
||
let drivers = { | ||
'account': accountDriverSpy, | ||
'contact': contactDriverSpy | ||
}; | ||
|
||
let driverLocator = { | ||
drivers: function () { | ||
return drivers; | ||
} | ||
}; | ||
|
||
let fs = {}; | ||
|
||
let tearDownCommand = new TearDownCommand( | ||
'./path/to/seed.json', | ||
driverLocator, | ||
fs | ||
); | ||
|
||
tearDownCommand.run(); | ||
|
||
accountDriverSpy.should.have.been.called.once; | ||
contactDriverSpy.should.have.been.called.once; | ||
}); | ||
}); |