Skip to content

Commit ceccac4

Browse files
committed
test: commit image url case
1 parent 2d71ca7 commit ceccac4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/tailwindcss-patch/test/context.test.ts

+12
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,16 @@ describe('common usage', () => {
4444
expect(set.size).toBe(5)
4545
expect(result).toMatchSnapshot()
4646
})
47+
48+
// https://github.com/sonofmagic/weapp-tailwindcss-webpack-plugin/issues/158
49+
it("bg-[url('img_src')] lose efficacy", () => {
50+
getCss([getTestCase('img-url.jsx')])
51+
const ctxs = getContexts()
52+
expect(ctxs).toBeTruthy()
53+
const set = getClassCacheSet()
54+
expect(set.size).toBeGreaterThan(0)
55+
expect(set.size).toBe(2)
56+
expect(Array.from(set.values())[1]).toBe("bg-[url('https://xxx.webp')]")
57+
//
58+
})
4759
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function Hello() {
2+
return <div className={`bg-[url('https://xxx.webp')]`}></div>
3+
}

0 commit comments

Comments
 (0)