linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

Ajax requests when testing #276

Closed mikeletscher closed 10 years ago

mikeletscher commented 10 years ago

Hi guys,

I have an ApiProxy set up for localhost; any requests to the API work when I run the application.

However, when I run specs, the port is not 8000 and the ApiProxy doesn't seem to be working. Am I missing a setting that would fix this?

In config/application.js:

server: {
      apiProxy: {
        enabled: true,
        host: 'localhost',
        port: 3000
      }
}

I'm using qUnit to test. The console shows a 404 for any requests.

Thanks so much! Lineman is awesome! Unfortunately, I don't think I can't upload the entire project because it's for work, but let me know if I can provide any more info.

searls commented 10 years ago

Ah I didn't realize you were running a test suite. The lineman spec command is designed for unit tests (that don't actually make network requests) and should not access the lineman dev server.

On Mon, Jun 9, 2014 at 4:10 PM, Mike Letscher notifications@github.com wrote:

Hi guys, I have an ApiProxy set up for localhost; any requests to the API work when I run the application. However, when I run specs, the port is not 8000 and the ApiProxy doesn't seem to be working. Am I missing a setting that would fix this? In config/application.js:

server: {
      apiProxy: {
        enabled: true,
        host: 'localhost',
        port: 3000
      }
}

I'm using qUnit to test. The console shows a 404 for any requests.

Thanks so much! Lineman is awesome! Unfortunately, I don't think I can't upload the entire project because it's for work, but let me know if I can provide any more info.

Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/276

mikeletscher commented 10 years ago

Ahh, okay. That makes sense. Thanks!

mikeletscher commented 10 years ago

Do you have any suggestions for integration testing?

searls commented 10 years ago

I would add a grunt-jasmine-bundle suite to the build (see jasmine-given's repo) or add lineman-spec-browser if I were going to want to do browser automation testing.

On Mon, Jun 9, 2014 at 4:47 PM, Mike Letscher notifications@github.com wrote:

Do you have any suggestions for integration testing?

Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/276#issuecomment-45541981

mikeletscher commented 10 years ago

Thanks Justin!