Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrary preprocessor order differs between platforms #2505

Open
pimterry opened this issue Dec 14, 2016 · 0 comments
Open

Arbitrary preprocessor order differs between platforms #2505

pimterry opened this issue Dec 14, 2016 · 0 comments

Comments

@pimterry
Copy link

Expected behaviour

(More generally: for a defined test suite, it should be run in the same way everywhere)

Actual behaviour

  • On Linux a different arbitrary preprocessor order is used to OSX & Windows

Environment Details

  • Karma version (output of karma --version): 1.3.0
  • Relevant part of your karma.config.js file
{
    preprocessors: {
        '**/*.coffee': [ 'browserify' ],
        '**/*.spec.coffee': [ 'env' ]
    }
}

(Trimmed, for a full example check out this commit, which uses the config in karma.conf.coffee, which combines custom options with defaults from resin-config-karma)

On Linux this worked correctly, on OSX and Windows the resulting code didn't contain the __env__ var that karma-env-preprocessor adds. It seems that this happens if env is run before browserify, but everything works fine if they run in the other order.

Changing the second preprocessor line to '**/*.spec.coffee': [ 'browserify', 'env' ] solves the problem, but wasn't clear initially (it's easy to make this change, merge it, and not realise it won't work on other platforms until another developer not using Linux finds it and has to debug the issues).

Steps to reproduce the behaviour

Full repro:

  1. Checkout this commit and npm install
  2. Create a .env including the vars from the readme: https://github.com/resin-io/resin-sdk#tests
  3. npm run build && npm run test-browser
  4. On linux the build (e.g. our Travis) will succeed, on OSX/Windows it rapidly fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants