Skip to content

Commit bdc7867

Browse files
committed
Fix karma config
1 parent d31cfff commit bdc7867

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

karma.conf.js

+23-11
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function testFiles(pkg) {
2323
files.push(returnFilePathOrThrow(`test/spec/manual/responsive-${pkg}-spec.js`));
2424

2525
if (pkg === 'jquery-file-upload') {
26-
files.push(returnFilePathOrThrow('test/spec/cloudinary-jquery-upload-spec.js'));
26+
files.push(returnFilePathOrThrow('test/spec/manual/cloudinary-jquery-upload-spec.js'));
2727
} else{
2828
files.push(returnFilePathOrThrow(`test/spec/manual/lazy-load-${pkg}-spec.js`));
2929
}
@@ -70,7 +70,27 @@ module.exports = function(config) {
7070
const lazyLoadBase = returnFilePathOrThrow(`test/spec/manual/lazyLoadTestBase.js`);
7171

7272
const responsiveHtmlFile = returnFilePathOrThrow(`test/docRoot/responsive-${pkg}-test.html`);
73-
const lazyLoadHtmlFile = returnFilePathOrThrow(`test/docRoot/lazy-load-${pkg}-test.html`);
73+
74+
let lazyLoadHtmlFile;
75+
if (pkg !== 'jquery-file-upload') {
76+
lazyLoadHtmlFile = returnFilePathOrThrow(`test/docRoot/lazy-load-${pkg}-test.html`);
77+
}
78+
79+
let pattern = [
80+
'{', // keep this first
81+
`dist/*.map`
82+
];
83+
84+
if (responsiveHtmlFile) {
85+
pattern.push(responsiveHtmlFile);
86+
}
87+
88+
pattern = pattern.concat([
89+
lazyLoadHtmlFile,
90+
`node_modules/bootstrap/dist/+(css|js)/*`,
91+
`test/docRoot/css/logo-nav.css`,
92+
'}' // keep this last
93+
]).join(',');
7494

7595
return config.set({
7696
// base path that will be used to resolve all patterns (eg. files, exclude)
@@ -86,15 +106,7 @@ module.exports = function(config) {
86106
lazyLoadBase,
87107
...testFiles(pkg),
88108
{
89-
pattern: [
90-
'{', // keep this first
91-
`dist/*.map`,
92-
responsiveHtmlFile,
93-
lazyLoadHtmlFile,
94-
`node_modules/bootstrap/dist/+(css|js)/*`,
95-
`test/docRoot/css/logo-nav.css`,
96-
'}' // keep this last
97-
].join(','),
109+
pattern,
98110
watched: false,
99111
included: false,
100112
served: true,

tools/scripts/test.pkgs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
for pkg in core jquery jquery-file-upload; do karma start --single-run --cloudinary.pkg=${pkg}; done
1+
for pkg in core jquery jquery-file-upload; do karma start --single-run --browsers=ChromeHeadless --cloudinary.pkg=${pkg}; done

0 commit comments

Comments
 (0)