kinesis-write-stream
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,7 @@ # Change Log | ||
## [1.0.2] - 2017-03-25 | ||
### Fixed | ||
- Pass record to getPartitionKey as stated in | ||
documentation. Contribution by @indieisaconcept. | ||
## [1.0.1] - 2015-11-04 | ||
@@ -7,0 +12,0 @@ ### Fixed |
@@ -71,3 +71,3 @@ 'use strict'; | ||
Data: JSON.stringify(record), | ||
PartitionKey: this.getPartitionKey() | ||
PartitionKey: this.getPartitionKey(record) | ||
}; | ||
@@ -74,0 +74,0 @@ }; |
{ | ||
"name": "kinesis-write-stream", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Kinesis writable stream that buffers up records", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -67,2 +67,33 @@ 'use strict'; | ||
}); | ||
it('should be called with the current record being added', function(done) { | ||
this.client.putRecords.yields(null, successResponseFixture); | ||
this.sinon.stub(this.stream, 'getPartitionKey').returns('1234'); | ||
this.stream.on('finish', function() { | ||
expect(this.stream.getPartitionKey).to.have.been.calledWith(recordsFixture[0]); | ||
done(); | ||
}.bind(this)); | ||
streamArray([recordsFixture[0]]) | ||
.pipe(this.stream); | ||
}); | ||
it('should use custom getPartitionKey if defined', function(done) { | ||
this.client.putRecords.yields(null, successResponseFixture); | ||
this.stream.getPartitionKey = function() { | ||
return 'custom-partition'; | ||
}; | ||
this.sinon.spy(this.stream, 'getPartitionKey'); | ||
this.stream.on('finish', function() { | ||
expect(this.stream.getPartitionKey).to.have.returned('custom-partition'); | ||
done(); | ||
}.bind(this)); | ||
streamArray(recordsFixture) | ||
.pipe(this.stream); | ||
}); | ||
}); | ||
@@ -69,0 +100,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17924
331
16