Skip to content

Commit

Permalink
bump js version to 2.2.0 (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
allenan authored Jul 24, 2023
1 parent cce72e5 commit a497164
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@helium/proto",
"version": "2.1.0",
"version": "2.2.0",
"description": "Helium protobuf definitions compiled to JS with TypeScript types",
"main": "build/index.js",
"repository": "[email protected]:helium/proto.git",
Expand Down
34 changes: 34 additions & 0 deletions test/service/poc_mobile.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const proto = require('../../build')

const PocMobile = proto.helium.poc_mobile

describe('seniority_update', () => {
it('can be constructed', () => {
const now = new Date().getTime()
const txn = PocMobile.seniority_update.create({
cbsdId: 'some_id',
newSeniorityTimestamp: now,
reason:
PocMobile.seniority_update_reason
.seniority_update_reason_heartbeat_not_seen,
})
expect(txn.cbsdId).toBe('some_id')
expect(txn.newSeniorityTimestamp).toBe(now)
expect(txn.reason).toBe(
PocMobile.seniority_update_reason
.seniority_update_reason_heartbeat_not_seen,
)
})

it('can be serialized', () => {
const txn = PocMobile.seniority_update.create({
cbsdId: 'some_id',
newSeniorityTimestamp: 123456789,
reason:
PocMobile.seniority_update_reason
.seniority_update_reason_heartbeat_not_seen,
})
const serializedTxn = PocMobile.seniority_update.encode(txn).finish()
expect(serializedTxn.toString('base64')).toBe('Cgdzb21lX2lkEJWa7zoYAA==')
})
})

0 comments on commit a497164

Please sign in to comment.