Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Support for mocha "root level hooks" #2

Open
michaelnthiessen opened this issue Aug 16, 2016 · 1 comment
Open

Support for mocha "root level hooks" #2

michaelnthiessen opened this issue Aug 16, 2016 · 1 comment

Comments

@michaelnthiessen
Copy link

michaelnthiessen commented Aug 16, 2016

From this issue with the core project.

My environment is setup using Babel, as all my source and tests are written in es2015.

To be able to run my tests using mocha, I run the following command:

mocha --require ignore-styles --require babel-core/register tests/ --recursive

The module babel-core/register is required in order to transform the es2015 code. I use ignore-styles because I am using SASS in my React components (which also needs to be compiled or it throws errors).

These root-level hooks, using the --require option, are modules that are run first, before any tests are loaded (?).

I think that all that needs to be done is ensuring that these "root-level hooks" are the first files that are fed to Mocha when using it programmatically. I don't have much experience there, but that's what I've gathered from looking around a bit.

@nicojs
Copy link
Member

nicojs commented Dec 31, 2016

Sorry for the late response. I have been thinking about this for a while. We would first need to add support for es2015 into Stryker. As of now, Stryker is not able to mutate all es2015 code (it breaks on import statements).

We'll first investigate that, before fixing this issue. Meanwhile, if anyone wants to have a go, please do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants