Mocha kooks with mochapack #113
Unanswered
sandeep-1983
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Everyone,
I am trying to set up mocha hooks using the 'require' option. My project is in Vue js and I am using Vue-CLI which uses mocha pack and but so far I have not had any success. The file is successfully loaded but mocha is not setting up the hooks. Can anyone pls suggest where I might be going wrong?
My setup is I have one hooks.js file which looks like below code and the command I am using is
vue-cli-service test:unit --colors --require ./pre-test.js --require ./tests/unit/hooks.js
hooks.js
exports.mochaHooks = { beforeAll(done) { console.log('[mochahooks] beforeAll'); done(); }, afterAll(done) { console.log('[mochahooks] afterAll'); done(); }, beforeEach() { console.log('[mochahooks] beforeEach'); }, afterEach() { console.log('[mochahooks] afterEach'); }, };
thanks,
Sandeep
Beta Was this translation helpful? Give feedback.
All reactions