How do I integrate (html) fixtures with testacular? Is there any recommendation for performing DOM based tests or is it an anti-pattern?
Objective : I am trying to test a custom module which parses the DOM tree and creates a new data structure. The DOM tree can be dynamic (like contents of a html/markdown editor) and hence is not a good candidate for end to end testing
Problem : I am trying to use jasmine-jquery for this DOM testing and in my testacular.conf.js, I have the section to allow loading of html files into the browser.
// list of files / patterns to load in the browser
files = [
JASMINE,
JASMINE_ADAPTER,
'test/spec/**/*.js',
'test/fixtures/*.html' **/* Needs to be included here to be served */**
];
However in my test runner on the command line, I get the following error message when I drop the html fixture(even before I write any jasmine-jquery code to load the fixture):
Chrome 22.0 **ERROR**
Uncaught SyntaxError: Unexpected token < at /Users/myUser/myProject/test/fixtures/fixture_template.html:1 Chrome 22.0: Executed 0 of 0 ERROR (0.143 secs / 0 secs)
EDIT : Another way to ask the same question : How do I get testacular to serve html and not blow up the test runner?
As I mentioned above, I need to include the 'test/fixtures/*.html" in the config but the test runner just blows up.