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

baseURL not respected in ember test #1003

Closed
harris opened this issue Jun 12, 2014 · 7 comments
Closed

baseURL not respected in ember test #1003

harris opened this issue Jun 12, 2014 · 7 comments

Comments

@harris
Copy link

harris commented Jun 12, 2014

Affected Version:
0.0.33,0.0.34 and potentially the older versions.

repro steps:

  1. create a new ember app with ember new some-app
  2. in config/environment.js, modify baseURL from '/' to '/some-app'
  3. run ember test

observed behavior:
command would get stuck

expected behavior:
test should finish running

potential fix:
change tests/index.html

-    {{BASE_TAG}}
+    <base href="/" /> 

     <script>
       window.SomeAppENV = {{ENV}};
+      window.SomeAppENV.baseURL = "/";  
       window.EmberENV = window.SomeAppENV.EmberENV;
     </script>

Would fix it for the phamton.js but would not fix tests when running in chrome.

@harris
Copy link
Author

harris commented Jun 23, 2014

ping

@rwjblue
Copy link
Member

rwjblue commented Jun 23, 2014

As you mentioned, simply removing the {{BASE_TAG}} isn't the right thing here, as we need slightly different behavior depending on if we are running via testem or the in-browser tests with ember server.

What would be ideal is to provide the test_page option to testem.startCI (currently it is defaulted to tests/index.html, but when using a non-slash baseURL it should really be my-app-name/tests/index.html), but it appears that testem does not respect a test_page path specified from the API (only from testem.json).

@rwjblue
Copy link
Member

rwjblue commented Jun 23, 2014

I need to think this through a bit more, but I fairly sure that we can make this work.

@harris
Copy link
Author

harris commented Jun 26, 2014

Thanks @rjackson! What you mentioned makes sense. Please keep me updated.

@rpieciorak
Copy link

any progress?

@dogawaf
Copy link

dogawaf commented Aug 12, 2014

I am running an ember in a node-webkit wrapper, and I need to put app://localhost/ in the base tag... Actually this is not allowed because the baseURL is checked for a leading slash.
Should we not allow to just put the raw baseURL in the config file (with the possibility to have a base tag per environment) and remove some magic arround the base tag?

@abuiles
Copy link
Member

abuiles commented Aug 25, 2014

Fixed with 0874e81

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

5 participants