Skip to content

Commit

Permalink
Release 0.7.0
Browse files Browse the repository at this point in the history
(and add missing test for 0.7.0)
  • Loading branch information
jlacivita committed Jun 21, 2022
1 parent c326097 commit 6e21d2a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 12 deletions.
21 changes: 11 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"dependencies": {
},
"devDependencies": {
"@firebolt-js/openrpc": "git://github.com/rdkcentral/firebolt-openrpc.git",
"@firebolt-js/schemas": "git://github.com/rdkcentral/firebolt-schemas.git",
"@firebolt-js/openrpc": "1.5.0",
"@firebolt-js/schemas": "0.2.0",
"ajv": "^6.12.6",
"jest": "^28.1.0",
"mkdirp": "^0.5.6",
Expand Down
47 changes: 47 additions & 0 deletions test/typescript/declarations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,50 @@ test('purchaseContent', () => {
expect(typeof result.totalCount).toBe('number')
})
})

const result: Discovery.EntityInfoResult = {
entity: {
"entityType": "program",
"identifiers": {
"entityId": "123"
},
"programType": "movie",
"title": "A title"
},
"expires": ""
}

test('entityInfo', () => {

return Discovery.entityInfo(result).then(() => {
let result:Discovery.EntityInfoResult = sent.find(message => message.method === 'entityInfo').params.result
expect(result.entity.identifiers.entityId).toBe("123")
})
})

test('entityInfo pull', () => {
let resolver
const p = new Promise((resolve, reject) => {
resolver = resolve
})

Discovery.entityInfo( (request: Discovery.EntityInfoParameters) => {
setTimeout( _ => {
resolver()
}, 1000)

return Promise.resolve(result)
})

Setup.emit('discovery', 'pullEntityInfo', {
correlationId: '123',
parameters: {
entityId: '123'
}
})

let result:Discovery.EntityInfoResult = sent.find(message => message.method === 'entityInfo').params.result
expect(result.entity.identifiers.entityId).toBe("123")

return p
})

0 comments on commit 6e21d2a

Please sign in to comment.