File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
packages/unplugin-tailwindcss-mangle Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 57
57
" tailwindcss" ,
58
58
" utilities" ,
59
59
" mangle" ,
60
- " class"
60
+ " class" ,
61
+ " obfuscator" ,
62
+ " obfuscation"
61
63
],
62
64
"author" :
" SonOfMagic <[email protected] >" ,
63
65
"license" : " MIT" ,
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` js handler common StringLiteral 1` ] = ` "element.innerHTML = "<div class =\\"tw-a tw-b\\">count is counter</div>";"`;
4
+
5
+ exports[`js handler common TemplateElement 1`] = `
6
+ " const counter = 0;
7
+ element.innerHTML = \`<div class=" tw-a tw-b">count is \${counter}</div>\`;"
8
+ `;
Original file line number Diff line number Diff line change
1
+ import { jsHandler } from '../src/js/index'
2
+ import ClassGenerator from '../src/classGenerator'
3
+ describe ( 'js handler' , ( ) => {
4
+ it ( 'common StringLiteral' , ( ) => {
5
+ const classGenerator = new ClassGenerator ( )
6
+ const runtimeSet = new Set < string > ( )
7
+ runtimeSet . add ( 'dark:bg-zinc-800/30' )
8
+ runtimeSet . add ( 'lg:dark:bg-zinc-800/30' )
9
+ // eslint-disable-next-line no-template-curly-in-string
10
+ const testCase = 'element.innerHTML = \'<div class="dark:bg-zinc-800/30 lg:dark:bg-zinc-800/30">count is counter</div>\''
11
+ const code = jsHandler ( testCase , {
12
+ classGenerator,
13
+ runtimeSet
14
+ } ) . code
15
+ expect ( code ) . toMatchSnapshot ( )
16
+ } )
17
+
18
+ it ( 'common TemplateElement' , ( ) => {
19
+ const classGenerator = new ClassGenerator ( )
20
+ const runtimeSet = new Set < string > ( )
21
+ runtimeSet . add ( 'dark:bg-zinc-800/30' )
22
+ runtimeSet . add ( 'lg:dark:bg-zinc-800/30' )
23
+ // eslint-disable-next-line no-template-curly-in-string
24
+ const testCase = 'const counter = 0;element.innerHTML = `<div class="dark:bg-zinc-800/30 lg:dark:bg-zinc-800/30">count is ${counter}</div>`'
25
+ const code = jsHandler ( testCase , {
26
+ classGenerator,
27
+ runtimeSet
28
+ } ) . code
29
+ expect ( code ) . toMatchSnapshot ( )
30
+ } )
31
+ } )
You can’t perform that action at this time.
0 commit comments