|
@@ -123,18 +123,16 @@ describe('SnapshotManager', function () {
|
|
|
describe('of a text file with no tracked changes', function () {
|
|
describe('of a text file with no tracked changes', function () {
|
|
|
beforeEach(function (done) {
|
|
beforeEach(function (done) {
|
|
|
this.HistoryStoreManager.getBlobStore.withArgs(this.historyId).returns({
|
|
this.HistoryStoreManager.getBlobStore.withArgs(this.historyId).returns({
|
|
|
- getString: BPromise.promisify(
|
|
|
|
|
- (this.getString = sinon.stub().yields(
|
|
|
|
|
- null,
|
|
|
|
|
- `\
|
|
|
|
|
|
|
+ getString: (this.getString = sinon.stub().resolves(
|
|
|
|
|
+ `\
|
|
|
Hello world
|
|
Hello world
|
|
|
|
|
|
|
|
One two three
|
|
One two three
|
|
|
|
|
|
|
|
Four five six\
|
|
Four five six\
|
|
|
`.replace(/^\t/g, '')
|
|
`.replace(/^\t/g, '')
|
|
|
- ))
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ )),
|
|
|
|
|
+ getObject: sinon.stub().rejects(),
|
|
|
})
|
|
})
|
|
|
this.SnapshotManager.getFileSnapshotStream(
|
|
this.SnapshotManager.getFileSnapshotStream(
|
|
|
this.projectId,
|
|
this.projectId,
|
|
@@ -185,7 +183,8 @@ Seven eight nine\
|
|
|
this.HistoryStoreManager.getBlobStore
|
|
this.HistoryStoreManager.getBlobStore
|
|
|
.withArgs(this.historyId)
|
|
.withArgs(this.historyId)
|
|
|
.returns({
|
|
.returns({
|
|
|
- getString: BPromise.promisify(sinon.stub().throws(this.error)),
|
|
|
|
|
|
|
+ getString: sinon.stub().rejects(this.error),
|
|
|
|
|
+ getObject: sinon.stub().rejects(this.error),
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -503,7 +502,8 @@ Four five six\
|
|
|
beforeEach(function () {
|
|
beforeEach(function () {
|
|
|
this.error = new Error('ESOCKETTIMEDOUT')
|
|
this.error = new Error('ESOCKETTIMEDOUT')
|
|
|
this.HistoryStoreManager.getBlobStore.withArgs(this.historyId).returns({
|
|
this.HistoryStoreManager.getBlobStore.withArgs(this.historyId).returns({
|
|
|
- getString: BPromise.promisify(sinon.stub().yields(this.error)),
|
|
|
|
|
|
|
+ getString: sinon.stub().rejects(this.error),
|
|
|
|
|
+ getObject: sinon.stub().resolves(),
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -571,18 +571,16 @@ Four five six\
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
this.HistoryStoreManager.getBlobStore.withArgs(this.historyId).returns({
|
|
this.HistoryStoreManager.getBlobStore.withArgs(this.historyId).returns({
|
|
|
- getString: BPromise.promisify(
|
|
|
|
|
- (this.getString = sinon.stub().yields(
|
|
|
|
|
- null,
|
|
|
|
|
- `\
|
|
|
|
|
|
|
+ getString: (this.getString = sinon.stub().resolves(
|
|
|
|
|
+ `\
|
|
|
Hello world
|
|
Hello world
|
|
|
|
|
|
|
|
One two three
|
|
One two three
|
|
|
|
|
|
|
|
Four five six\
|
|
Four five six\
|
|
|
`.replace(/^\t/g, '')
|
|
`.replace(/^\t/g, '')
|
|
|
- ))
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ )),
|
|
|
|
|
+ getObject: sinon.stub().rejects(),
|
|
|
})
|
|
})
|
|
|
this.SnapshotManager.getLatestSnapshot(
|
|
this.SnapshotManager.getLatestSnapshot(
|
|
|
this.projectId,
|
|
this.projectId,
|