aurelia / testing

Simplifies the testing of UI components by providing an elegant, fluent interface for arranging test setups along with a number of runtime debug/test helpers.
MIT License
40 stars 27 forks source link

Error loading html #13

Closed forestmarie closed 8 years ago

forestmarie commented 8 years ago

My gist is here:

https://gist.github.com/forestmarie/bcedbd2a51162aafdefeb677c56c2be2

The error I get is below. I get this in both wallaby or running gulp tdd. This is a jspm solution.

If I change the argument of withResources to a component that does not exist, it'll give an error stating it can't find that JavaScript which makes sense. Here it's just complaining about the components .html file. Is there more setup I need to do? Trying to reverse engineer the blog. Any ideas?

Failed: XHR error loading http://localhost:36251/src/resources/drop-downs/drop-down.html Error loading http://localhost:36251/src/resources/drop-downs/drop-down.html!text Error loading http://localhost:36251/src/resources/drop-downs/drop-down.html!template-registry-entry

Quick edit: Just pasted the exact component example from the blog and received the same error - xhr loading my-component.html. Wanted to make sure the component I was testing didn't have any special edge cases as it is pretty involved and has about 8 bindables.

EisenbergEffect commented 8 years ago

Did you update your Karma configuration? There was a change that was required in order to make this work correctly. Notice serveFiles: ['src/**/*.*'], has been changed so it isn't restricted to JS. Let me know if that works.

forestmarie commented 8 years ago

That did the trick in karma for sure. Looking at your wallaby in the skeleton vs. mine has a few differences. Do you know what I need to change in my wallaby.js or if this is possible to run in wallaby yet?

EisenbergEffect commented 8 years ago

I don't know much about wallaby. Our skeleton's wallaby may not be fixed. See if it's got some path info and that html is included. Let me know what error you are getting.

forestmarie commented 8 years ago

It works - my command line was on the wrong project. Your skeleton, however, won't work as it's only loading the JavaScript.

I put this in my wallaby under files: { pattern: 'src/*/.js', load: false }, { pattern: 'src/*/.html', load: false },

Thanks

EisenbergEffect commented 8 years ago

Interested in sending us a PR for the fix? ;)

forestmarie commented 8 years ago

Sure. I'll put it in early next week.