diff --git a/packages/css/tests/keyframes.test.ts b/packages/css/tests/keyframes.test.ts index e3d49d6ea..4ee222665 100644 --- a/packages/css/tests/keyframes.test.ts +++ b/packages/css/tests/keyframes.test.ts @@ -15,7 +15,7 @@ it('expects the animation output', async () => { p.id = 'mp' p.classList.add('@fade|1s') document.body.append(p) - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).toContain('.\\@fade\\|1s{animation:fade 1s}') }) @@ -33,7 +33,7 @@ it('expects the keyframe output', async () => { '@zoom|1s', '{@zoom|1s;f:16}' ) - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).toContain('@keyframes fade{0%{opacity:0}to{opacity:1}}') expect(window.masterCSS.text).toContain('@keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}') expect(window.masterCSS.text).toContain('@keyframes float{0%{transform:none}50%{transform:translateY(-1.25rem)}to{transform:none}}') @@ -45,36 +45,36 @@ it('expects the keyframe output', async () => { expect(window.masterCSS.text).toContain('@keyframes shake{0%{transform:none}6.5%{transform:translateX(-6px) rotateY(-9deg)}18.5%{transform:translateX(5px) rotateY(7deg)}31.5%{transform:translateX(-3px) rotateY(-5deg)}43.5%{transform:translateX(2px) rotateY(3deg)}50%{transform:none}}') expect(window.masterCSS.text).toContain('@keyframes zoom{0%{transform:scale(0)}to{transform:none}}') p?.classList.remove('@fade|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes fade{0%{opacity:0}to{opacity:1}}') p?.classList.remove('@flash|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}') p?.classList.remove('@float|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes float{0%{transform:none}50%{transform:translateY(-1.25rem)}to{transform:none}}') p?.classList.remove('@heart|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes heart{0%{transform:scale(1)}14%{transform:scale(1.3)}28%{transform:scale(1)}42%{transform:scale(1.3)}70%{transform:scale(1)}}') p?.classList.remove('@jump|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes jump{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0,0,.2,1)}}') p?.classList.remove('@ping|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes ping{75%,to{transform:scale(2);opacity:0}}') p?.classList.remove('@pulse|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes pulse{0%{transform:none}50%{transform:scale(1.05)}to{transform:none}}') p?.classList.remove('@rotate|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes rotate{0%{transform:rotate(-360deg)}to{transform:none}}') p?.classList.remove('@shake|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes shake{0%{transform:none}6.5%{transform:translateX(-6px) rotateY(-9deg)}18.5%{transform:translateX(5px) rotateY(7deg)}31.5%{transform:translateX(-3px) rotateY(-5deg)}43.5%{transform:translateX(2px) rotateY(3deg)}50%{transform:none}}') p?.classList.remove('@zoom|1s') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).toContain('@keyframes zoom{0%{transform:scale(0)}to{transform:none}}') p?.classList.remove('{@zoom|1s;f:16}') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).not.toContain('@keyframes zoom{0%{transform:scale(0)}to{transform:none}}') }) \ No newline at end of file diff --git a/packages/css/tests/runtime.test.ts b/packages/css/tests/runtime.test.ts index b752a1ed7..3ef2c7579 100644 --- a/packages/css/tests/runtime.test.ts +++ b/packages/css/tests/runtime.test.ts @@ -14,7 +14,7 @@ it('css count class add', async () => { p1.classList.add('block', 'font:bold') document.body.append(p1) p1.classList.add('italic') - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.classesUsage).toEqual({ 'block': 1, 'font:bold': 1, @@ -24,9 +24,9 @@ it('css count class add', async () => { it('css count class complicated example', async () => { document.body.innerHTML = complexHTML - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(Object.keys(window.masterCSS.classesUsage).length).toBeTruthy() document.body.innerHTML = '' - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.classesUsage).toEqual({}) }) \ No newline at end of file diff --git a/packages/css/tests/variables.test.ts b/packages/css/tests/variables.test.ts index 35d92456d..35dc00292 100644 --- a/packages/css/tests/variables.test.ts +++ b/packages/css/tests/variables.test.ts @@ -41,7 +41,7 @@ it('expects the variable output', async () => { p.id = 'mp' p.classList.add('bg:first') document.body.append(p) - await new Promise(resolve => setTimeout(resolve)) + await new Promise(resolve => setTimeout(resolve, 100)) expect(window.masterCSS.text).toContain(':root{--first:17 17 17}.dark{--first:34 34 34}.light{--first:51 51 51}.bg\\:first{background-color:rgb(var(--first))}') })