This error was hard to find for us. We write tests more in a module like way, so that a fixture in HTML has the same name as the test file in JS and is in the same path. In the test we setup the path to the fixtures separately to the module's path. So basically it could be possible that we use the same classnames but in different namespaces. But if two fixtures have the same name in different paths, it is cached only by the fixture's basename. So it in either test it loads the wrong fixture.
And now depending on the order of test execution does either moduleA.class or moduleB.class load the wrong cached fixture, because they both have the same basename class.html.
I know this is not the way it is documented, but it is more practical to have the fixtures along with the tests, because we deevelop in a kind of hostile environment, where it is necessary to provide different fixtures for tests of a class.
jQuery-jasmine does not support a more module like approach to write tests with fixtures, because the keys inside the fixturesCache_ is based on the relative path without the configured fixturePath.
This error was hard to find for us. We write tests more in a module like way, so that a fixture in HTML has the same name as the test file in JS and is in the same path. In the test we setup the path to the fixtures separately to the module's path. So basically it could be possible that we use the same classnames but in different namespaces. But if two fixtures have the same name in different paths, it is cached only by the fixture's basename. So it in either test it loads the wrong fixture.
So our testfile structure is like this:
And our tests are sctructured like this for
moduleA/class.spec.js
:And for
moduleB/class.spec.js
:And now depending on the order of test execution does either
moduleA.class
ormoduleB.class
load the wrong cached fixture, because they both have the same basenameclass.html
. I know this is not the way it is documented, but it is more practical to have the fixtures along with the tests, because we deevelop in a kind of hostile environment, where it is necessary to provide different fixtures for tests of a class. jQuery-jasmine does not support a more module like approach to write tests with fixtures, because the keys inside thefixturesCache_
is based on the relative path without the configuredfixturePath
.