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

No Babel transpilation in PhantomJS #116

Open
jstaro opened this issue Dec 8, 2015 · 3 comments
Open

No Babel transpilation in PhantomJS #116

jstaro opened this issue Dec 8, 2015 · 3 comments

Comments

@jstaro
Copy link

jstaro commented Dec 8, 2015

My config works fine in Chrome, but in PhantomJS, as soon as I try to import an ES6 class in my spec files, karma spits out a not-so-helpful Attempting to configurable [sic] attribute of unconfigurable property.

I can import ES5 modules just fine in specs.

Not importing anything in my spec files, but rewriting the Jasmine tests using ES6 fat arrow syntax makes PhantomJS balk with a SyntaxError: Parse error message.

All this makes me believe files are not being transpiled.

karma.conf.js

module.exports = function (config) {
    config.set({
        frameworks: ['jspm', 'jasmine', 'phantomjs-shim'],
        jspm: {
            loadFiles: ['specs/**/*.js'],
            serveFiles: ['app/**/*.js']
        },
        browsers: ['PhantomJS']
    });
}

package versions

[...]
  "devDependencies": {
    "jasmine-core": "^2.4.1",
    "jspm": "^0.16.15",
    "karma": "^0.13.15",
    "karma-chrome-launcher": "^0.2.2",
    "karma-jasmine": "^0.3.6",
    "karma-jasmine-diff-reporter": "^0.3.1",
    "karma-jspm": "^2.0.2",
    "karma-phantomjs-launcher": "^0.2.1",
    "karma-phantomjs-shim": "^1.1.2",
    "phantomjs": "^1.9.19"
  },
  "jspm": {
    "dependencies": {
      "angular": "github:angular/bower-angular@^1.4.8",
      "angular-ui-router": "github:angular-ui/ui-router@^0.2.15",
      "jasmine": "npm:jasmine@^2.4.1",
      "lodash": "npm:lodash@^3.10.1",
      "text": "github:systemjs/plugin-text@^0.0.4"
    },
    "devDependencies": {
      "babel": "npm:babel-core@^5.8.24",
      "babel-runtime": "npm:babel-runtime@^5.8.24",
      "core-js": "npm:core-js@^1.1.4"
    }
  }
[...]
@Offirmo
Copy link

Offirmo commented Mar 3, 2016

+1

@dpix
Copy link

dpix commented Jun 22, 2016

I'm having this same issue with typescript transpilation. Tests run fine in Chrome but fail in Phantom.

If I re-write my tests to be vanilla js they are interpreted and run fine

@dpix
Copy link

dpix commented Jun 22, 2016

I managed to fix this by including core-js before loading my tests

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

No branches or pull requests

3 participants