I have an Angular project with Storybook as a design system. I want to integrate visual testing for it. I use Jest with puppeteer and image snapshot. Locally it is running fine but on GitLab, the pipeline is failing, because the font is rendered differently. I use a specific font but it is also included in the GitLab environment but it seems more stretched:
I also run the same docker container locally and on GitLab.
Here is my jest.config.js
process.env.JEST_PUPPETEER_CONFIG = 'node_modules/jest-puppeteer-docker/src/config.js';
module.exports = {
preset: 'jest-puppeteer-docker',
rootDir: '../',
setupFilesAfterEnv: [
'<rootDir>/.jest/jest-puppeteer.config.js'
],
testMatch: [
'<rootDir>/.storybook/visual-tests/*.visual-test.js'
]
};
And my jest-puppeteer.config.js
module.exports = {
launch: {
headless: true,
args: [
'--enable-font-antialiasing=false',
'--font-render-hinting=medium',
'--no-sandbox',
'--disable-setuid-sandbox'
]
}
};
It would be great if somebody could help me with this.