Skip to content

Instantly share code, notes, and snippets.

@buritica
Created July 30, 2018 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buritica/571bfc3901a3ee31c59565c4edef97ed to your computer and use it in GitHub Desktop.
Save buritica/571bfc3901a3ee31c59565c4edef97ed to your computer and use it in GitHub Desktop.
jest test environment boilerplate
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