From 16556d08183a80155549be1014c32fbb19765e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Sat, 29 Jan 2022 17:51:06 +0100 Subject: [PATCH] fix: do not transform mask-type Fix #643 --- .../src/__snapshots__/index.test.ts.snap | 4 ++-- packages/hast-util-to-babel-ast/src/index.test.ts | 13 +++++++++---- packages/hast-util-to-babel-ast/src/mappings.ts | 1 - 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/hast-util-to-babel-ast/src/__snapshots__/index.test.ts.snap b/packages/hast-util-to-babel-ast/src/__snapshots__/index.test.ts.snap index dc1bf524..1ea9512e 100644 --- a/packages/hast-util-to-babel-ast/src/__snapshots__/index.test.ts.snap +++ b/packages/hast-util-to-babel-ast/src/__snapshots__/index.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`hast-util-to-babel-ast should correctly transform svg 1`] = `"{\\"Dismiss\\"}{\\"Created with Sketch.\\"};"`; - exports[`hast-util-to-babel-ast should handle spaces and tab 1`] = `";"`; + +exports[`hast-util-to-babel-ast transforms SVG 1`] = `"{\\"Dismiss\\"}{\\"Created with Sketch.\\"};"`; diff --git a/packages/hast-util-to-babel-ast/src/index.test.ts b/packages/hast-util-to-babel-ast/src/index.test.ts index 30e30547..2bb78c64 100644 --- a/packages/hast-util-to-babel-ast/src/index.test.ts +++ b/packages/hast-util-to-babel-ast/src/index.test.ts @@ -13,7 +13,7 @@ function transform(code: string) { } describe('hast-util-to-babel-ast', () => { - it('should correctly transform svg', () => { + it('transforms SVG', () => { const code = ` @@ -32,27 +32,32 @@ describe('hast-util-to-babel-ast', () => { expect(transform(code)).toMatchSnapshot() }) - it('should correctly transform aria-x', () => { + it('transforms "aria-x"', () => { const code = `` expect(transform(code)).toMatchInlineSnapshot( `";"`, ) }) - it('should correctly transform aria-xxxXxx', () => { + it('transforms "aria-xxxXxx"', () => { const code = `` expect(transform(code)).toMatchInlineSnapshot( `";"`, ) }) - it('should correctly transform data-x', () => { + it('transformss "data-x"', () => { const code = `` expect(transform(code)).toMatchInlineSnapshot( `";"`, ) }) + it('preserves "mask-type"', () => { + const code = `` + expect(transform(code)).toBe(';') + }) + it('should handle spaces and tab', () => { const code = `