Answer the question
In order to leave comments, you need to log in
How to add script attribute to tag in karma config?
Or how can this be done at all?
It is necessary for the script that is being tested to set an attribute (the value of which may be different), the script reads it.
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'dist/main.js',
'dist/tests/main.spec.js'
],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeHeadless'],
singleRun: true,
concurrency: Infinity
});
};
<script src="[main.js]" data-components="component1, component2"></script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question