Skip to content

Commit

Permalink
Update snapshots and Node.js compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tancredi committed Nov 18, 2022
1 parent 79d3300 commit 0541ce2
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
}
},
"engines": {
"node": ">= 10.0.0"
"node": ">= 12.0.0"
}
}
14 changes: 7 additions & 7 deletions src/generators/asset-types/__tests__/__snapshots__/css.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -41,7 +41,7 @@ b[class^=\\"tf-\\"]:before, b[class*=\\" tf-\\"]:before {
}
.tf-my-icon:before {
content: \\"\\\\f101\\";
content: "\\f101";
}
"
`;
12 changes: 6 additions & 6 deletions src/generators/asset-types/__tests__/__snapshots__/html.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

exports[`\`HTML\` asset generator renders HTML correctly with prefix and tag name options 1`] = `
"<!DOCTYPE html>
<html lang=\\"en\\">
<html lang="en">
<head>
<meta charset=\\"UTF-8\\">
<meta charset="UTF-8">
<title>test-font</title>
<style>
Expand Down Expand Up @@ -52,16 +52,16 @@ exports[`\`HTML\` asset generator renders HTML correctly with prefix and tag nam
}
</style>
<link rel=\\"stylesheet\\" type=\\"text/css\\" href=\\"test-font.css\\" />
<link rel="stylesheet" type="text/css" href="test-font.css" />
</head>
<body>
<h1>test-font</h1>
<div class=\\"preview\\">
<span class=\\"inner\\">
<b class=\\"tf tf-my-icon\\"></b>
<div class="preview">
<span class="inner">
<b class="tf tf-my-icon"></b>
</span>
<br>
<span class='label'>my-icon</span>
Expand Down
18 changes: 9 additions & 9 deletions src/generators/asset-types/__tests__/__snapshots__/sass.ts.snap
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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")
"
`;
18 changes: 9 additions & 9 deletions src/generators/asset-types/__tests__/__snapshots__/scss.ts.snap
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
Expand All @@ -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");
}
"
`;
Original file line number Diff line number Diff line change
@@ -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"]}$"`;
84 changes: 42 additions & 42 deletions src/generators/asset-types/__tests__/__snapshots__/ts.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,45 @@

exports[`\`TS\` asset generator generates constant only 1`] = `
"export const MY_ICONS_SET_CODEPOINTS: Record<string, string> = {
\\"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",
};
"
`;
Expand Down Expand Up @@ -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",
};
"
`;

0 comments on commit 0541ce2

Please sign in to comment.