From 0541ce28f7bce1244fb3f366f9f8302041945570 Mon Sep 17 00:00:00 2001 From: Tancredi Trugenberger Date: Fri, 18 Nov 2022 14:43:03 +0000 Subject: [PATCH] Update snapshots and Node.js compatibility --- .github/workflows/test.yaml | 2 +- package.json | 2 +- .../__tests__/__snapshots__/css.ts.snap | 14 ++-- .../__tests__/__snapshots__/html.ts.snap | 12 +-- .../__tests__/__snapshots__/sass.ts.snap | 18 ++-- .../__tests__/__snapshots__/scss.ts.snap | 18 ++-- .../__tests__/__snapshots__/svg.ts.snap | 4 +- .../__tests__/__snapshots__/ts.ts.snap | 84 +++++++++---------- 8 files changed, 77 insertions(+), 77 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6e5959d0..3b69e4ca 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -38,7 +38,7 @@ jobs: fail-fast: false matrix: os: [macOS-10.15, ubuntu-18.04, windows-2019] - node: [10.x, 14.x, 16.x] + node: [12.x, 16.x, 18.x, 19.x] steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index 1d4a3962..b58395a6 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,6 @@ } }, "engines": { - "node": ">= 10.0.0" + "node": ">= 12.0.0" } } diff --git a/src/generators/asset-types/__tests__/__snapshots__/css.ts.snap b/src/generators/asset-types/__tests__/__snapshots__/css.ts.snap index 327000d1..8220719f 100644 --- a/src/generators/asset-types/__tests__/__snapshots__/css.ts.snap +++ b/src/generators/asset-types/__tests__/__snapshots__/css.ts.snap @@ -2,8 +2,8 @@ exports[`\`CSS\` asset generator renders CSS correctly with \`selector\` option 1`] = ` "@font-face { - font-family: \\"test-font\\"; - src: \\"::src-attr::\\"; + font-family: "test-font"; + src: "::src-attr::"; } .my-selector:before { @@ -18,18 +18,18 @@ exports[`\`CSS\` asset generator renders CSS correctly with \`selector\` option } .my-selector.tf-my-icon:before { - content: \\"\\\\f101\\"; + content: "\\f101"; } " `; exports[`\`CSS\` asset generator renders CSS correctly with prefix and tag name options 1`] = ` "@font-face { - font-family: \\"test-font\\"; - src: \\"::src-attr::\\"; + font-family: "test-font"; + src: "::src-attr::"; } -b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before { +b[class^="tf-"]:before, b[class*=" tf-"]:before { font-family: test-font !important; font-style: normal; font-weight: normal !important; @@ -41,7 +41,7 @@ b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before { } .tf-my-icon:before { - content: \\"\\\\f101\\"; + content: "\\f101"; } " `; diff --git a/src/generators/asset-types/__tests__/__snapshots__/html.ts.snap b/src/generators/asset-types/__tests__/__snapshots__/html.ts.snap index 95f53b7f..a3e256a9 100644 --- a/src/generators/asset-types/__tests__/__snapshots__/html.ts.snap +++ b/src/generators/asset-types/__tests__/__snapshots__/html.ts.snap @@ -2,9 +2,9 @@ exports[`\`HTML\` asset generator renders HTML correctly with prefix and tag name options 1`] = ` " - + - + test-font - +

test-font

-
- - +
+ +
my-icon diff --git a/src/generators/asset-types/__tests__/__snapshots__/sass.ts.snap b/src/generators/asset-types/__tests__/__snapshots__/sass.ts.snap index 5aadd4ef..cf2f5653 100644 --- a/src/generators/asset-types/__tests__/__snapshots__/sass.ts.snap +++ b/src/generators/asset-types/__tests__/__snapshots__/sass.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`\`SASS\` asset generator renders SASS correctly with \`selector\` option 1`] = ` -"$test-font: \\"test\\" +"$test-font: "test" @font-face font-family: $test-font - src: \\"::src-attr::\\" + src: "::src-attr::" .my-selector:before font-family: test !important @@ -19,22 +19,22 @@ exports[`\`SASS\` asset generator renders SASS correctly with \`selector\` optio $test-map: ( - \\"my-icon\\": \\"\\\\f101\\", + "my-icon": "\\f101", ) .my-selector.tf-my-icon:before - content: map-get($test-map, \\"my-icon\\") + content: map-get($test-map, "my-icon") " `; exports[`\`SASS\` asset generator renders SASS correctly with prefix and tag name options 1`] = ` -"$test-font: \\"test\\" +"$test-font: "test" @font-face font-family: $test-font - src: \\"::src-attr::\\" + src: "::src-attr::" -b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before +b[class^="tf-"]:before, b[class*=" tf-"]:before font-family: test !important font-style: normal font-weight: normal !important @@ -46,10 +46,10 @@ b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before $test-map: ( - \\"my-icon\\": \\"\\\\f101\\", + "my-icon": "\\f101", ) .tf-my-icon:before - content: map-get($test-map, \\"my-icon\\") + content: map-get($test-map, "my-icon") " `; diff --git a/src/generators/asset-types/__tests__/__snapshots__/scss.ts.snap b/src/generators/asset-types/__tests__/__snapshots__/scss.ts.snap index a36d572b..b54400ab 100644 --- a/src/generators/asset-types/__tests__/__snapshots__/scss.ts.snap +++ b/src/generators/asset-types/__tests__/__snapshots__/scss.ts.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`\`SCSS\` asset generator renders SCSS correctly with \`selector\` option 1`] = ` -"$test-font: \\"test\\"; +"$test-font: "test"; @font-face { font-family: $test-font; - src: \\"::src-attr::\\"; + src: "::src-attr::"; } .my-selector:before { @@ -20,24 +20,24 @@ exports[`\`SCSS\` asset generator renders SCSS correctly with \`selector\` optio } $test-map: ( - \\"my-icon\\": \\"\\\\f101\\", + "my-icon": "\\f101", ); .my-selector.tf-my-icon:before { - content: map-get($test-map, \\"my-icon\\"); + content: map-get($test-map, "my-icon"); } " `; exports[`\`SCSS\` asset generator renders SCSS correctly with prefix and tag name options 1`] = ` -"$test-font: \\"test\\"; +"$test-font: "test"; @font-face { font-family: $test-font; - src: \\"::src-attr::\\"; + src: "::src-attr::"; } -b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before { +b[class^="tf-"]:before, b[class*=" tf-"]:before { font-family: test !important; font-style: normal; font-weight: normal !important; @@ -49,11 +49,11 @@ b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before { } $test-map: ( - \\"my-icon\\": \\"\\\\f101\\", + "my-icon": "\\f101", ); .tf-my-icon:before { - content: map-get($test-map, \\"my-icon\\"); + content: map-get($test-map, "my-icon"); } " `; diff --git a/src/generators/asset-types/__tests__/__snapshots__/svg.ts.snap b/src/generators/asset-types/__tests__/__snapshots__/svg.ts.snap index 20613f4f..ba83630b 100644 --- a/src/generators/asset-types/__tests__/__snapshots__/svg.ts.snap +++ b/src/generators/asset-types/__tests__/__snapshots__/svg.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`\`SVG\` font generator passes correctly format options to \`SVGIcons2SVGFontStream\` 1`] = `"processed->content->/root/foo.svg|{\\"name\\":\\"foo\\",\\"unicode\\":[\\"\\\\u0001\\"]}$processed->content->/root/bar.svg|{\\"name\\":\\"bar\\",\\"unicode\\":[\\"\\\\u0001\\"]}$"`; +exports[`\`SVG\` font generator passes correctly format options to \`SVGIcons2SVGFontStream\` 1`] = `"processed->content->/root/foo.svg|{"name":"foo","unicode":["\\u0001"]}$processed->content->/root/bar.svg|{"name":"bar","unicode":["\\u0001"]}$"`; -exports[`\`SVG\` font generator resolves with the result of the completed \`SVGIcons2SVGFontStream\` 1`] = `"processed->content->/root/foo.svg|{\\"name\\":\\"foo\\",\\"unicode\\":[\\"\\\\u0001\\"]}$processed->content->/root/bar.svg|{\\"name\\":\\"bar\\",\\"unicode\\":[\\"\\\\u0001\\"]}$"`; +exports[`\`SVG\` font generator resolves with the result of the completed \`SVGIcons2SVGFontStream\` 1`] = `"processed->content->/root/foo.svg|{"name":"foo","unicode":["\\u0001"]}$processed->content->/root/bar.svg|{"name":"bar","unicode":["\\u0001"]}$"`; diff --git a/src/generators/asset-types/__tests__/__snapshots__/ts.ts.snap b/src/generators/asset-types/__tests__/__snapshots__/ts.ts.snap index 3f501f1e..74517ab6 100644 --- a/src/generators/asset-types/__tests__/__snapshots__/ts.ts.snap +++ b/src/generators/asset-types/__tests__/__snapshots__/ts.ts.snap @@ -2,45 +2,45 @@ exports[`\`TS\` asset generator generates constant only 1`] = ` "export const MY_ICONS_SET_CODEPOINTS: Record = { - \\"foo\\": \\"4265\\", - \\"bar\\": \\"1231\\", + "foo": "4265", + "bar": "1231", }; " `; exports[`\`TS\` asset generator generates constant with literalId if no enum generated 1`] = ` "export type MyIconsSetId = - | \\"foo\\" - | \\"bar\\"; + | "foo" + | "bar"; export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSetId]: string } = { - \\"foo\\": \\"4265\\", - \\"bar\\": \\"1231\\", + "foo": "4265", + "bar": "1231", }; " `; exports[`\`TS\` asset generator generates constant with literalKey if no enum generated 1`] = ` "export type MyIconsSetKey = - | \\"Foo\\" - | \\"Bar\\"; + | "Foo" + | "Bar"; export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSetKey]: string } = { - \\"foo\\": \\"4265\\", - \\"bar\\": \\"1231\\", + "foo": "4265", + "bar": "1231", }; " `; exports[`\`TS\` asset generator generates no key string literal type if option passed like that 1`] = ` "export enum MyIconsSet { - Foo = \\"foo\\", - Bar = \\"bar\\", + Foo = "foo", + Bar = "bar", } export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSet]: string } = { - [MyIconsSet.Foo]: \\"4265\\", - [MyIconsSet.Bar]: \\"1231\\", + [MyIconsSet.Foo]: "4265", + [MyIconsSet.Bar]: "1231", }; " `; @@ -68,67 +68,67 @@ export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSet]: string } = { exports[`\`TS\` asset generator prevents enum keys that start with digits 1`] = ` "export type MyIconsSetId = - | \\"1234\\" - | \\"5678\\"; + | "1234" + | "5678"; export type MyIconsSetKey = - | \\"i1234\\" - | \\"i5678\\"; + | "i1234" + | "i5678"; export enum MyIconsSet { - i1234 = \\"1234\\", - i5678 = \\"5678\\", + i1234 = "1234", + i5678 = "5678", } export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSet]: string } = { - [MyIconsSet.i1234]: \\"undefined\\", - [MyIconsSet.i5678]: \\"undefined\\", + [MyIconsSet.i1234]: "undefined", + [MyIconsSet.i5678]: "undefined", }; " `; exports[`\`TS\` asset generator prevents enum keys that start with digits when digits and chars 1`] = ` "export type MyIconsSetId = - | \\"1234asdf\\" - | \\"5678ab\\" - | \\"foo\\"; + | "1234asdf" + | "5678ab" + | "foo"; export type MyIconsSetKey = - | \\"i1234asdf\\" - | \\"i5678ab\\" - | \\"Foo\\"; + | "i1234asdf" + | "i5678ab" + | "Foo"; export enum MyIconsSet { - i1234asdf = \\"1234asdf\\", - i5678ab = \\"5678ab\\", - Foo = \\"foo\\", + i1234asdf = "1234asdf", + i5678ab = "5678ab", + Foo = "foo", } export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSet]: string } = { - [MyIconsSet.i1234asdf]: \\"undefined\\", - [MyIconsSet.i5678ab]: \\"undefined\\", - [MyIconsSet.Foo]: \\"4265\\", + [MyIconsSet.i1234asdf]: "undefined", + [MyIconsSet.i5678ab]: "undefined", + [MyIconsSet.Foo]: "4265", }; " `; exports[`\`TS\` asset generator renders expected TypeScript module content 1`] = ` "export type MyIconsSetId = - | \\"foo\\" - | \\"bar\\"; + | "foo" + | "bar"; export type MyIconsSetKey = - | \\"Foo\\" - | \\"Bar\\"; + | "Foo" + | "Bar"; export enum MyIconsSet { - Foo = \\"foo\\", - Bar = \\"bar\\", + Foo = "foo", + Bar = "bar", } export const MY_ICONS_SET_CODEPOINTS: { [key in MyIconsSet]: string } = { - [MyIconsSet.Foo]: \\"4265\\", - [MyIconsSet.Bar]: \\"1231\\", + [MyIconsSet.Foo]: "4265", + [MyIconsSet.Bar]: "1231", }; " `;