diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbe3eb6..a795ff8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,8 +34,16 @@ jobs: GATSBY_VERSION: ${{ matrix.gatsby-version }} NODE_VERSION: ${{ matrix.node-version }} - name: Run tests + if: matrix.os == '4.24.0' run: | cat node_modules/gatsby/package.json | grep "\"version\"" yarn test env: CI: true + - name: Run tests + if: matrix.os != '4.24.0' + run: | + cat node_modules/gatsby/package.json | grep "\"version\"" + yarn test -- --testNamePattern='^(?!tracedSVG)' + env: + CI: true diff --git a/test/graphql.test.js b/test/graphql.test.js index 3d1c455..10f8b4c 100644 --- a/test/graphql.test.js +++ b/test/graphql.test.js @@ -1,13 +1,9 @@ const { render } = require('datocms-structured-text-to-html-string'); const buildQueryExecutor = require('./support/buildQueryExecutor'); -const { version } = require('gatsby/package.json'); - -const gatsbyMajorVersion = parseInt(version.split('.')[0]); jest.setTimeout(60000); let executeQuery; -let quit; beforeAll(async () => { try { @@ -118,68 +114,66 @@ test('focalPoints', async () => { }); // https://github.com/gatsbyjs/gatsby/discussions/37104 -if (gatsbyMajorVersion < 5) { - test('tracedSVG', async () => { - const result = await executeQuery(/* GraphQL */ ` - { - datoCmsArticle(originalId: { eq: "7364344" }) { - singleAsset { - fluid( - maxWidth: 150 - imgixParams: { w: "150", h: "40", fit: "crop" } - ) { - tracedSVG - } - blurhashFluid: fluid( - maxWidth: 150 - forceBlurhash: true - imgixParams: { w: "150", h: "40", fit: "crop" } - ) { - tracedSVG - } - tracedSvgFluidGatsbyImage: gatsbyImageData( - width: 150 - placeholder: TRACED_SVG - layout: CONSTRAINED - imgixParams: { w: "150", h: "40", fit: "crop" } - ) - } - assetGallery { - fluid( - maxWidth: 150 - imgixParams: { w: "150", h: "40", fit: "crop" } - ) { - tracedSVG - } - blurhashFluid: fluid( - maxWidth: 150 - forceBlurhash: true - imgixParams: { w: "150", h: "40", fit: "crop" } - ) { - tracedSVG - } - tracedSvgFluidGatsbyImage: gatsbyImageData( - width: 150 - placeholder: TRACED_SVG - layout: CONSTRAINED - imgixParams: { w: "150", h: "40", fit: "crop" } - ) +test('tracedSVG', async () => { + const result = await executeQuery(/* GraphQL */ ` + { + datoCmsArticle(originalId: { eq: "7364344" }) { + singleAsset { + fluid( + maxWidth: 150 + imgixParams: { w: "150", h: "40", fit: "crop" } + ) { + tracedSVG } + blurhashFluid: fluid( + maxWidth: 150 + forceBlurhash: true + imgixParams: { w: "150", h: "40", fit: "crop" } + ) { + tracedSVG + } + tracedSvgFluidGatsbyImage: gatsbyImageData( + width: 150 + placeholder: TRACED_SVG + layout: CONSTRAINED + imgixParams: { w: "150", h: "40", fit: "crop" } + ) } - assetWhichIsSvg: datoCmsAsset(originalId: { eq: "10015565" }) { - fixed(width: 300) { + assetGallery { + fluid( + maxWidth: 150 + imgixParams: { w: "150", h: "40", fit: "crop" } + ) { tracedSVG } - fluid(maxWidth: 300) { + blurhashFluid: fluid( + maxWidth: 150 + forceBlurhash: true + imgixParams: { w: "150", h: "40", fit: "crop" } + ) { tracedSVG } + tracedSvgFluidGatsbyImage: gatsbyImageData( + width: 150 + placeholder: TRACED_SVG + layout: CONSTRAINED + imgixParams: { w: "150", h: "40", fit: "crop" } + ) + } + } + assetWhichIsSvg: datoCmsAsset(originalId: { eq: "10015565" }) { + fixed(width: 300) { + tracedSVG + } + fluid(maxWidth: 300) { + tracedSVG } } - `); + } + `); - expect(result).toMatchSnapshot(); - }); -} + expect(result).toMatchSnapshot(); +}); test('auto=format', async () => { const result = await executeQuery(/* GraphQL */ `