Created
July 30, 2018 01:46
-
-
Save buritica/571bfc3901a3ee31c59565c4edef97ed to your computer and use it in GitHub Desktop.
jest test environment boilerplate
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 NodeEnvironment = require('jest-environment-node') | |
const debug = require('debug')('ec-test:environment') | |
/** | |
* | |
*/ | |
class CustomEnvironment extends NodeEnvironment { | |
constructor (config) { | |
super(config) | |
} | |
async setup () { | |
debug('test setup') | |
await super.setup() | |
} | |
async teardown () { | |
debug('test teardown') | |
await super.teardown() | |
} | |
runScript (script) { | |
return super.runScript(script) | |
} | |
} | |
module.exports = CustomEnvironment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment