Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (18 sloc) 0.407 kb
assert = require 'assert'
Brain = require '../src/brain'
saved = false
closing = false
closed = false
brain = new Brain
brain.on 'save', (data) ->
is_closing = closing
saved = closing = true
brain.close() if !is_closing
assert.equal 1, data.abc
brain.on 'close', ->
closed = true
brain.data.abc = 1
brain.resetSaveInterval 0.1
process.on 'exit', ->
assert.ok saved
assert.ok closed
Jump to Line
Something went wrong with that request. Please try again.