Skip to content

Commit

Permalink
Fixing tests (TravisCI failing builds for Node 6)
Browse files Browse the repository at this point in the history
  • Loading branch information
TemaSM committed Aug 28, 2018
1 parent cf3ed36 commit fd617de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/storageFileAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let localSession = new LocalSession(options)

// Wait for database async initialization finished
before((done) => {
localSession.DB.then(DB => { done() })
localSession.DB.then((DB) => { done() })
})

describe('Telegraf Session local : storageFileAsync', () => {
Expand All @@ -22,7 +22,7 @@ describe('Telegraf Session local : storageFileAsync', () => {
debug('getSession %O', session)
should.exist(session)
session.foo = 42
localSession.saveSession(key, session).then(_session => {
localSession.saveSession(key, session).then((_session) => {
debug('Saved session %O', _session)
should.exist(_session)
_session.data.should.be.deepEqual({ foo: 42 })
Expand Down Expand Up @@ -82,14 +82,14 @@ describe('Telegraf Session local : storageFileAsync', () => {
let _options = Object.assign({ storage: LocalSession.storagefileAsync }, options)
let _localSession = new LocalSession(_options)
// Wait for database async initialization finished
_localSession.DB.then(DB => {
_localSession.DB.then((DB) => {
// console.log(DB.get('sessions').getById('1:1').value())
const key = '1:1' // ChatID:FromID
let session = _localSession.getSession(key)
debug('getSession %O', session)
should.exist(session)
session.foo = 42
_localSession.saveSession(key, session).then(_session => {
_localSession.saveSession(key, session).then((_session) => {
debug('Saved session %O', _session)
should.exist(_session)
_session.data.should.be.deepEqual({ foo: 42 })
Expand Down
6 changes: 3 additions & 3 deletions tests/storageFileSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Telegraf Session local : storageFileSync', () => {
debug('getSession %O', session)
should.exist(session)
session.foo = 42
localSession.saveSession(key, session).then(_session => {
localSession.saveSession(key, session).then((_session) => {
debug('Saved session %O', _session)
should.exist(_session)
_session.data.should.be.deepEqual({ foo: 42 })
Expand Down Expand Up @@ -73,15 +73,15 @@ describe('Telegraf Session local : storageFileSync', () => {
bot.handleUpdate({ message: { chat: { id: 1 }, from: { id: 1 }, text: 'hey' } })
})

it('storageFileSync: Should work properly with deprecated stoarge name - storagefileSync', async (done) => {
it('storageFileSync: Should work properly with deprecated stoarge name - storagefileSync', (done) => {
let _options = Object.assign({ storage: LocalSession.storagefileSync }, options)
let _localSession = new LocalSession(_options)
const key = '1:1' // ChatID:FromID
let session = _localSession.getSession(key)
debug('getSession %O', session)
should.exist(session)
session.foo = 42
_localSession.saveSession(key, session).then(_session => {
_localSession.saveSession(key, session).then((_session) => {
debug('Saved session %O', _session)
should.exist(_session)
_session.data.should.be.deepEqual({ foo: 42 })
Expand Down

0 comments on commit fd617de

Please sign in to comment.