Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['./jest.setup.js'],
transform: {
'\\.js$': ['babel-jest', { configFile: './config/babel.config.js' }],
Expand Down
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@
"license": "MIT",
"dependencies": {
"colord": "^2.9.3",
"prop-types": "^15.7.2"
"prop-types": "^15.8.1"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.26.8",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"babel-jest": "^26.6.0",
"@babel/core": "^7.28.3",
"@babel/plugin-transform-runtime": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@babel/preset-react": "^7.27.1",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.8.0",
"@testing-library/react": "^16.3.0",
"babel-jest": "^30.0.5",
"component-image": "^2.1.1",
"jest": "^26.6.0",
"jest-image-snapshot": "^4.2.0",
"microbundle": "^0.12.4",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"jest": "^30.0.5",
"jest-environment-jsdom": "^30.0.5",
"jest-image-snapshot": "^6.5.1",
"microbundle": "^0.15.1",
"react": "^19.1.1",
"react-dom": "^19.1.1"
},
"peerDependencies": {
"react": "^19.0.0 || ^18.0.0 || ^17.0.0 || ^16.2.0",
Expand Down
11 changes: 8 additions & 3 deletions src/__tests__/FileIcon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ expect.extend({ toMatchImageSnapshot });

import { FileIcon, defaultStyles } from '../../dist/react-file-icon';

const PUPPETEER_OPTIONS = {
args: ['--no-sandbox', '--disable-dev-shm-usage'],
};

const renderWithStyle = content => {
return render(
<div
Expand Down Expand Up @@ -237,6 +241,7 @@ describe('<FileIcon />', () => {
width: 600,
height: 160,
},
puppeteerOptions: PUPPETEER_OPTIONS,
});
expect(image).toMatchImageSnapshot();
});
Expand All @@ -258,6 +263,7 @@ describe('<FileIcon />', () => {
width: 600,
height: 160,
},
puppeteerOptions: PUPPETEER_OPTIONS,
});
expect(image).toMatchImageSnapshot();
});
Expand Down Expand Up @@ -286,6 +292,7 @@ describe('<FileIcon />', () => {
width: 600,
height: 160,
},
puppeteerOptions: PUPPETEER_OPTIONS,
});
expect(image).toMatchImageSnapshot();
});
Expand All @@ -307,9 +314,7 @@ describe('<FileIcon />', () => {
width: 600,
height: 160,
},
puppeteerOptions: {
args: ['--no-sandbox', '--disable-dev-shm-usage'],
},
puppeteerOptions: PUPPETEER_OPTIONS,
});
expect(image).toMatchImageSnapshot();
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions src/__tests__/__snapshots__/FileIcon.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`<FileIcon /> border radius variations render correctly 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down Expand Up @@ -441,7 +441,7 @@ exports[`<FileIcon /> border radius variations render correctly 1`] = `

exports[`<FileIcon /> color variations render correctly 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down Expand Up @@ -1108,7 +1108,7 @@ exports[`<FileIcon /> color variations render correctly 1`] = `

exports[`<FileIcon /> file type glyphs render correctly 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down Expand Up @@ -2344,7 +2344,7 @@ exports[`<FileIcon /> file type glyphs render correctly 1`] = `

exports[`<FileIcon /> label colors render correctly 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down Expand Up @@ -2951,7 +2951,7 @@ exports[`<FileIcon /> label colors render correctly 1`] = `

exports[`<FileIcon /> renders uppercase label when labelUppercase is true 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down Expand Up @@ -3058,7 +3058,7 @@ exports[`<FileIcon /> renders uppercase label when labelUppercase is true 1`] =

exports[`<FileIcon /> standard arrangements render correctly 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down Expand Up @@ -3495,7 +3495,7 @@ exports[`<FileIcon /> standard arrangements render correctly 1`] = `

exports[`<FileIcon /> unique file icons render correctly 1`] = `
<div
style="font-family: Arial;"
style="-webkit-font-smoothing: antialiased; font-family: Arial;"
>
<svg
style="max-width: 100%;"
Expand Down
Loading