diff --git a/lib/sign-out.js b/lib/sign-out.js index 659152b..6c91b89 100644 --- a/lib/sign-out.js +++ b/lib/sign-out.js @@ -38,10 +38,12 @@ function signOut (state) { cacheKey: state.cacheKey }) - state.emitter.emit('signout', clone(state.account)) + var accountClone = clone(state.account) delete state.account + state.emitter.emit('signout', accountClone) + var postHooks = [] // note: the `pre:signout` & `post:signout` events are not considered public diff --git a/test/integration/sign-out-test.js b/test/integration/sign-out-test.js index 69480dd..9caacaa 100644 --- a/test/integration/sign-out-test.js +++ b/test/integration/sign-out-test.js @@ -6,12 +6,7 @@ var Account = require('../../index') var baseURL = 'http://localhost:3000' -// prepared test for https://github.com/hoodiehq/camp/issues/9 -// 1. replace `test.skip` with just `test` -// 2. run `$ node test/integration/sign-out-test.js` -// 3. you should see "not ok 1 should be equal" -// 4. remove all comments and commit change with "test: signout event timing hoodiehq/camp#9" -test.skip('sign out', function (t) { +test('sign out', function (t) { t.plan(1) // simulate signed in user