Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get this to work when the project root is not the webroot #46

Closed
at0g opened this issue Nov 27, 2013 · 2 comments
Closed

Can't get this to work when the project root is not the webroot #46

at0g opened this issue Nov 27, 2013 · 2 comments

Comments

@at0g
Copy link

at0g commented Nov 27, 2013

Hello, I'm trying to get this to work in my project but it seems to have issues with pathing when the project root is not the webroot.

My project runs an express server, where {projectroot}/public is mounted by express as "/" and {projectroot}/client/bower_components is mounted as "/vendor".

I've set the jasmine task like so:

jasmine: {
src: {
cwd: 'public/js/app',
expand: true,
src: 'Application.js'
},
options: {
host: 'http://127.0.0.1:8080/',
specs: 'test/spec/*_/_Spec.js',
keepRunner: true,
outfile: 'public/_SpecRunner.html',
template: require('grunt-template-jasmine-requirejs'),
templateOptions: {
requireConfigFile: 'public/js/require.config.js',
}
}
}

If I run grunt jasmine --v, I see this in my terminal:

Files: public/js/app/Application.js -> Application.js

However, it gets rewritten to a relative path eg. 'js/app/Application'.
My baseUrl in the require config is 'js/app', so the path does not resolve.
If I change the baseUrl to ".", then no dependencies in my project will resolve.

Is there a way to get the template to set a directory as the webroot that is used for path rewrites?

@geekytime
Copy link

I am having this same issue, and I believe it is also related to #36, and #45.

It seems that several of the dirs in the context/template are set up relative to the gruntfile, instead of relative to the outfile like they really should be. This is critical for projects that want to run their Jasmine tests from their app server's public or static folder, instead of from a static server at the root.

@cloudchen
Copy link
Owner

Fixed in v0.1.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants