Closed louismrose closed 10 years ago
For anyone else who faces this issue, I should mention that I'm using a symlink task in Grunt to workaround this for now: I add a symlink to the .grunt directory from the directory to which my spec runner is generated.
I used a grunt-contrib-copy task to work around this. I modified the template file, stored it out of the node_modules directory, and as part of my unit test grunt task I copy it over the original each time. Symlinks weren't an option for me as we're both *nix and Windows.
Thanks for the symlink idea.
I just submitted pull request https://github.com/cloudchen/grunt-template-jasmine-requirejs/pull/45 which would allow the user to set requireFile
as a template option as a path relative to the outfile (_SpecRunner.html)
Fixed in v0.1.10
Hi,
Thanks so much for this template, which has saved me masses of time in getting our app ported over to Grunt!
I've noticed what I think might be a slight issues with the template that generates the Jasmine spec runner. It seems that the generated script tag for require.js always uses the absolute path, rather than the relative path, to the ".grunt" folder. More specifically, line 11 of the template (
<script src="<%= temp %>/require.js"></script>
) generates<script src=".grunt/grunt-contrib-jasmine/require.js"></script>
Curiously, the script tags that reference other files in the .grunt directory do not have this issue. For my setup they generate the correct relative path, such as
<script src="../.grunt/grunt-contrib-jasmine/jasmine.js"></script>
I've taken a quick look at the grunt-contrib-jasmine project, and it seems to provide a function called
getRelativeFileList
that might be used to solve this issue. I don't feel that I know enough about the internals of either project to provide a patch, but would be happy to do so if somebody could provide a little bit of direction -- is this the right approach? And how would we access thegetRelativeFileList
function in the template provide by grunt-template-jasmine-requirejs?Thanks for any help!
Cheers, Louis.