Revue configuration karma.js, notamment pour chargement local des vidéos pour les tests + test dans version headless des navigateurs.

This commit is contained in:
Fabrice PENHOËT 2022-01-18 18:15:33 +01:00
parent a726ff51fe
commit da9277ca53
2 changed files with 5 additions and 3 deletions

View File

@ -12,7 +12,9 @@ module.exports = function(config) {
frameworks: ["jasmine", "karma-typescript"],
// list of files / patterns to load in the browser
files: [ "src/vCarousel.ts", "tests/*.ts" ],
files: [ "src/vCarousel.ts", "tests/*.ts", { pattern: 'public/videos/*', watched: true, included: false, served: true } ],
proxies: { "/videos/": "http://localhost:9876/base/public/videos/" },
// list of files / patterns to exclude
exclude: [
@ -45,7 +47,7 @@ module.exports = function(config) {
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Firefox', 'Chromium'],
browsers: ['FirefoxHeadless', 'ChromiumHeadless'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits

View File

@ -4,7 +4,7 @@ const errors=require("../src/errors.js");
describe("vCarousel", () =>
{
let vCarouselTest : vCarousel;
const videosWebDir="https://forge.chapril.org/Fab_Blab/vCarousel/src/branch/master/public/videos";
const videosWebDir="hhttp://localhost:9876/videos";
const fixture="<div id='fixture'><figure id='noVideo'></figure><figure id='video1'><video controls='controls' preload='metadata'><source src='"+videosWebDir+"/Lizio-Poete-Ferrailleur-clownfunanbule.m4v' type='video/mp4'></source></video></figure><figure id='video2'><video controls='controls' preload='metadata'><source src='"+videosWebDir+"/Lizio-Poete-Ferrailleur-forgeron.m4v' type='video/mp4'></source></video></figure><figure id='video3'><video controls='controls' preload='metadata'><source src='"+videosWebDir+"/Lizio-Poete-Ferrailleur-drole-de-circuit.m4v' type='video/mp4'></source></video></div>";
beforeEach(() =>