I have a single-page Angular app with a Rails backend. I am using a tag in my index.html file, but when I run my front-end unit tests using Karma, I get this:<
If you can't or do not want to set requireBase to false, the solution - as others pointed out - is to add in the header of your primary HTML file. To do this, you will need to specify custom HTML files for Karma, which you can then edit.
First find and copy node_modules/karma/static/context.html and node_modules/karma/static/debug.html to your unit test folder, and amend the headers of both.
Then in your karma.conf.js add the following two lines:
customContextFile: 'test/unit/context.html',
customDebugFile: 'test/unit/debug.html',
Of course your path may vary.