cloudchen / grunt-template-jasmine-requirejs

RequireJS template for grunt-contrib-jasmine task
111 stars 96 forks source link

Fix for #52 - Change contexts temp value according jasmine script sources #53

Closed schorfES closed 10 years ago

schorfES commented 10 years ago

This should fix the issue when a wrong path to require.js lib is used when jasmines outfile option is specified.

cloudchen commented 10 years ago

Thanks for you attention and PR. Because this template has no idea of where the location of spec runner is, which depends on exporting of grunt-contrib-jasmine, I have sent PR to request needed information by grunt-contrib-jasmine. We can proceed as long as that PR is accepted.

schorfES commented 10 years ago

Yes, you're right. Doing it this way would be a better approach!

But when it's added into the grunt-contrib-jasmine task, we have to keep in mind to calculate the relative path to the Gruntfile.js where the .gruntdirectory will be located.

Will the temporary .grunt directory always be in the same location as the Gruntfile.js? So it's possible to simply use __dirname to calculate the correct relative location?

cloudchen commented 10 years ago

__dirname doesn't work for that. It always returns node_modules/grunt-template-jasmine-requirejs/src which doesn't help.

What we only need to calculate is that the relative path of require.js file to spec_runner.html.

The location of .grunt folder doesn't matter I think.

schorfES commented 10 years ago

Okay, my bad! _"What we only need to calculate is that the relative path of require.js file to specrunner.html." - Thats right. I've seen your pull request has been put into the upcoming version 2.0...

cloudchen commented 10 years ago

Fixed in v0.1.10