jdcataldo / grunt-mocha-phantomjs

A simple grunt wrapper for mocha-phantomjs to allow for ci integration
MIT License
70 stars 40 forks source link

Support for phantom '--web-security' : false #29

Closed krunkosaurus closed 10 years ago

krunkosaurus commented 10 years ago

Can we build in support for disabling security options in phantom within mocha_phantomjs Grunt task options?

jdcataldo commented 10 years ago

Support should be there already. https://github.com/metaskills/mocha-phantomjs#usage

Using --settings you can set `webSecurityEnabled to false.

mocha_phantomjs: {
  no_output: {
    options: {
      'reporter': 'dot',
      'settings': 'webSecurityEnabled=false'
    },
    files: {
      src: ['test/index.html']
    }
  }
}
KrisSiegel commented 8 years ago

Is this meant to still work? This doesn't seem to work as expected with the latest version. I'm getting a NETWORK_ERR: XMLHttpRequest Exception 101 when attempting to make an AJAX call from tests running with mocha_phantomjs.

KrisSiegel commented 8 years ago

Nevermind I figured it out; looks like the syntax is different (that or there is some other way to make the above solution to work and there are two ways to do it).

mocha_phantomjs: {
    options: {
        phantomConfig:{
            "--web-security": false
        }
    },
    files: {
        src: ["test/specRunner.html"]
    }
}