nathanboktae / mocha-casperjs

Write CasperJS tests using Mocha
MIT License
120 stars 30 forks source link

Allow specifying opts file & test directory #96

Closed windkomo closed 8 years ago

windkomo commented 8 years ago

Usage :

Option file path :

mocha-casperjs --opts=path/to/file/file.opts

Add test directory in the opts file:

test/casperjs/tests
[other options]

Fix #95

nathanboktae commented 8 years ago

Sorry for not responding earlier but I paused since all the tests failed.

Also add a test for this feature with something like

      it 'should use an opts file from another location', (done) ->
        fs.writeFileSync 'mocha-casperjs.opts', '--user-agent=wrong-optsfile'
        fs.writeFileSync 'some-other-mocha-casperjs.opts', '--user-agent=some-other-mocha-casperjs-opts'
        runMochaCasperJsTest
          params: ['--reporter=json']
          test: ->
            casper.page.settings.userAgent.should.equal 'some-other-mocha-casperjs-opts'
        , (output, code) ->
          results = JSON.parse output
          results.stats.passes.should.equal 1
          results.stats.failures.should.equal 0
          done()
windkomo commented 8 years ago

@nathanboktae Thanks for the feedback, I made some changes that I hope will suit you

nathanboktae commented 8 years ago

Thanks for the good work :)