Last active
September 18, 2018 14:25
-
-
Save eddyystop/ae7e861af0eec701e724bfc74e9aa6e6 to your computer and use it in GitHub Desktop.
Template generated by feathers-plus/cli for a hook unit test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = require('assert'); | |
const verifyEmail = require('../../../../src/hooks/discard'); | |
describe('Test /hooks/discard.unit.test.js', () => { | |
// eslint-disable-next-line no-unused-vars | |
let contextBefore, contextAfterPaginated, | |
// eslint-disable-next-line no-unused-vars | |
contextAfter, contextAfterMultiple; | |
beforeEach(() => { | |
contextBefore = { | |
type: 'before', | |
params: { provider: 'socketio' }, | |
data: { | |
} | |
}; | |
contextAfter = { | |
type: 'after', | |
params: { provider: 'socketio' }, | |
result: { | |
} | |
}; | |
contextAfterMultiple = { | |
type: 'after', | |
params: { provider: 'socketio' }, | |
result: [ | |
] | |
}; | |
contextAfterPaginated = { | |
type: 'after', | |
method: 'find', | |
params: { provider: 'socketio' }, | |
result: { | |
data: [ | |
] | |
} }; | |
contextAfterPaginated.result.total = contextAfterPaginated.result.data.length; | |
}); | |
it('Hook exists', () => { | |
assert(typeof verifyEmail === 'function', 'Hook is not a function.'); | |
}); | |
it('???', () => { | |
contextBefore.method = 'create'; | |
/* | |
verifyEmail()(contextBefore); | |
assert.deepEqual(contextBefore.data, { | |
}); | |
*/ | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment