1

I'd like to run my tests in PhantomJS using yeoman test as well as in browser using yeoman server:test. The problem though is that PhantomJS doesn't find my includes in my index.html:

<script src="scripts/view/customer_view.js"></script>

...because it looks inside the test/-directory. Of course it would work if I tell my coffee-task to duplicate all the files into the test/-directory as well. But that seems wrong.

So, is there any way to use:

  1. the same include paths for headless and browser?
  2. the same files that have already been created in /temp/scripts? (because I use CoffeeScript)
kraftwer1
  • 5,253
  • 10
  • 36
  • 54

1 Answers1

1

After digging deeper on GitHub, I found out that I have to replace the URI in the Gruntfile.js:

// headless testing through PhantomJS
// mocha: {
jasmine: {
    // all: ["test/**/*.html"]
    all: ["http://localhost:3501/index.html"]
}

Note

As of Yeoman 0.9.6 it's also required to modify the grunt task:

// Alias the `test` task to run the `jasmine` task instead
// grunt.registerTask("test", "jasmine");
grunt.registerTask("test", "server:phantom jasmine");
kraftwer1
  • 5,253
  • 10
  • 36
  • 54