UNPKG

@absolute/change-tracker-node-sdk

Version:

ChangeTracker SDK for Node.js

24 lines (16 loc) 781 B
//store integration test const {store} = require('../src/core/remoteClient'); const {Table, Row} = require('../src/models'); const {generateToken} = require('../src/core/token'); test('integration test. Use remoteClient to store data on DynamoDB', async () => { const hostName = 'hostname'; //hostname const secret = 'XXXXXXXX'; //post token const tableName = 'testTable'; const rowKey = 'testRowKey'; let token = generateToken(secret, tableName, rowKey); expect(token).not.toBeNull(); expect(token).not.toBeUndefined(); const res = await store(hostName, token, Table.createTable([new Row('TESTROWKEY')], 'TESTTABLE', 'TESTUSER', '127.0.0.1')); expect(res).toMatchObject({ok: true}); //check data on test DB })