Skip to content

Commit

Permalink
test(es/codegen): Add tests for @ctrl/tinycolor (#8518)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #8475
 - #8496 (Fixed by #8510)
  • Loading branch information
kdy1 authored Jan 19, 2024
1 parent e63a5c7 commit 1c4eb1f
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
63 changes: 63 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/issue-8475/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false
},
"loose": false,
"minify": {
"compress": {
"arguments": false,
"arrows": true,
"booleans": true,
"booleans_as_integers": false,
"collapse_vars": true,
"comparisons": true,
"computed_props": true,
"conditionals": true,
"dead_code": true,
"directives": true,
"drop_console": false,
"drop_debugger": true,
"evaluate": true,
"expression": false,
"hoist_funs": false,
"hoist_props": true,
"hoist_vars": false,
"if_return": true,
"join_vars": true,
"keep_classnames": false,
"keep_fargs": true,
"keep_fnames": false,
"keep_infinity": false,
"loops": true,
"negate_iife": true,
"properties": true,
"reduce_funcs": false,
"reduce_vars": false,
"side_effects": true,
"switches": true,
"typeofs": true,
"unsafe": false,
"unsafe_arrows": false,
"unsafe_comps": false,
"unsafe_Function": false,
"unsafe_math": false,
"unsafe_symbols": false,
"unsafe_methods": false,
"unsafe_proto": false,
"unsafe_regexp": false,
"unsafe_undefined": false,
"unused": true,
"const_to_let": true,
"pristine_globals": true
}
},
"target": "es2022"
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}
9 changes: 9 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/issue-8475/input/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 4.x
export const CSS_INTEGER = '[-\\+]?\\d+%?';
export const CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
export const CSS_UNIT = `(?:${CSS_NUMBER})\|(?:${CSS_INTEGER})`;

// 3.x
export var CSS_INTEGER2 = '[-\\+]?\\d+%?';
export var CSS_NUMBER2 = '[-\\+]?\\d*\\.\\d+%?';
export var CSS_UNIT2 = "(?:".concat(CSS_NUMBER, ")\|(?:").concat(CSS_INTEGER, ")");
6 changes: 6 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/issue-8475/output/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const CSS_INTEGER = '[-\\+]?\\d+%?';
export const CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
export const CSS_UNIT = `(?:${CSS_NUMBER})\|(?:${CSS_INTEGER})`;
export var CSS_INTEGER2 = '[-\\+]?\\d+%?';
export var CSS_NUMBER2 = '[-\\+]?\\d*\\.\\d+%?';
export var CSS_UNIT2 = "(?:".concat(CSS_NUMBER, ")\|(?:").concat(CSS_INTEGER, ")");

0 comments on commit 1c4eb1f

Please sign in to comment.