-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(codec): encode Modified state, throw error on invalid type
- Makefiles were updated to recursively run all tests - check added to Codec.encode to throw if the type is unknown - fixed Modified state to use 'boolean' instead of 'bool' - a few other test cleanups regarding naming, extraneous console.logs, etc closes #176
- Loading branch information
Showing
8 changed files
with
38 additions
and
10 deletions.
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
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
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
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,21 @@ | ||
"use strict"; | ||
var BufferBuilder = require('buffer-builder'), | ||
expect = require('chai').expect, | ||
|
||
codec = require('../../../lib/codec'), | ||
DeliveryState = require('../../../lib/types/delivery_state'); | ||
|
||
// @todo: this suite could use some actual structure, but for the moment | ||
// accurately tests the issue reported | ||
describe('Types(DeliveryState)', function() { | ||
it('should encode Modified states', function() { | ||
var buffer = new BufferBuilder(); | ||
var type = new DeliveryState.Modified({ | ||
deliveryFailed: true, undeliverableHere: true, messageAnnotations: {} | ||
}); | ||
|
||
codec.encode(type, buffer); | ||
expect(buffer.get()) | ||
.to.eql(new Buffer([0x00, 0x53, 0x27, 0xc0, 0x06, 0x03, 0x41, 0x41, 0xc1, 0x01, 0x00])); | ||
}); | ||
}); |