Skip to content

Exporting constants causes karma to crash and fail silentlyΒ #2

Closed
@ccampbell

Description

@ccampbell

Im not sure this is specifically related to this plugin.

Karma config is similar to the one in your README.

To reproduce

  1. Create a test file test/something.js that looks like this:

    import { Something } from '../src/something';
    
    const expect = chai.expect;
    
    describe('Something', () => {
        it('Should exist', () => {
            expect(Something).to.exist;
        });
    });
  2. Create module src/something.js that looks like this:

    export function Something() {}
    export const SOME_CONST = 123;

Then run karma with PhantomJS, and you will notice that it fails silently. If you take out this plugin from your karma config, it will work correctly. It also works fine if you comment out this line:

// export const SOME_CONST = 123;

It took me a while to trace it down this far. Let me know if I can help further

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions