Skip to content

Commit bb830e6

Browse files
committed
test: update
1 parent 3aa6a45 commit bb830e6

File tree

5 files changed

+38
-26
lines changed

5 files changed

+38
-26
lines changed
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import path from 'path';
22
import { fixtures, launchAppWithPage } from './utils';
33

4+
rstest.setConfig({ testTimeout: 180_000, hookTimeout: 180_000 });
5+
46
describe('use tailwindcss v2', () => {
57
test(`should show style by use tailwindcss theme`, async () => {
68
const appDir = path.resolve(fixtures, 'tailwindcss-v2');
79
const { page, clear } = await launchAppWithPage(appDir);
10+
try {
11+
const primaryColorElement = await page.waitForSelector('.bg-primary');
12+
const backgroundColor = await page.evaluate(element => {
13+
const style = window.getComputedStyle(element);
14+
return style.backgroundColor;
15+
}, primaryColorElement);
816

9-
const primaryColorElement = await page.waitForSelector('.bg-primary');
10-
const backgroundColor = await page.evaluate(element => {
11-
const style = window.getComputedStyle(element);
12-
return style.backgroundColor;
13-
}, primaryColorElement);
14-
15-
expect(backgroundColor).toMatch(/rgb\(0, 0, 255\)|#0000ff|blue/i);
16-
17-
await clear();
17+
expect(backgroundColor).toMatch(/rgb\(0, 0, 255\)|#0000ff|blue/i);
18+
} finally {
19+
await clear();
20+
}
1821
});
1922
});
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import path from 'path';
22
import { fixtures, launchAppWithPage } from './utils';
33

4+
rstest.setConfig({ testTimeout: 180_000, hookTimeout: 180_000 });
5+
46
describe('use tailwindcss v3', () => {
57
test(`should show style by use tailwindcss theme`, async () => {
68
const appDir = path.resolve(fixtures, 'tailwindcss-v3');
79
const { page, clear } = await launchAppWithPage(appDir);
10+
try {
11+
const primaryColorElement = await page.waitForSelector('.bg-primary');
12+
const backgroundColor = await page.evaluate(element => {
13+
const style = window.getComputedStyle(element);
14+
return style.backgroundColor;
15+
}, primaryColorElement);
816

9-
const primaryColorElement = await page.waitForSelector('.bg-primary');
10-
const backgroundColor = await page.evaluate(element => {
11-
const style = window.getComputedStyle(element);
12-
return style.backgroundColor;
13-
}, primaryColorElement);
14-
15-
expect(backgroundColor).toMatch(/rgb\(0, 0, 255\)|#0000ff|blue/i);
16-
17-
await clear();
17+
expect(backgroundColor).toMatch(/rgb\(0, 0, 255\)|#0000ff|blue/i);
18+
} finally {
19+
await clear();
20+
}
1821
});
1922
});
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import path from 'path';
22
import { fixtures, launchAppWithPage } from './utils';
33

4+
rstest.setConfig({ testTimeout: 180_000, hookTimeout: 180_000 });
5+
46
describe('use tailwindcss v4', () => {
57
test(`should show style by use tailwindcss theme`, async () => {
68
const appDir = path.resolve(fixtures, 'tailwindcss-v4');
79
const { page, clear } = await launchAppWithPage(appDir);
8-
const primaryColorElement = await page.waitForSelector('.bg-primary');
9-
const backgroundColor = await page.evaluate(element => {
10-
const style = window.getComputedStyle(element);
11-
return style.backgroundColor;
12-
}, primaryColorElement);
13-
14-
expect(backgroundColor).toMatch(/rgb\(0, 0, 255\)|#0000ff|blue/i);
10+
try {
11+
const primaryColorElement = await page.waitForSelector('.bg-primary');
12+
const backgroundColor = await page.evaluate(element => {
13+
const style = window.getComputedStyle(element);
14+
return style.backgroundColor;
15+
}, primaryColorElement);
1516

16-
await clear();
17+
expect(backgroundColor).toMatch(/rgb\(0, 0, 255\)|#0000ff|blue/i);
18+
} finally {
19+
await clear();
20+
}
1721
});
1822
});

tests/rstest.adapter.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export default defineConfig({
55
'integration/rstest/**/rstest.config.{ts,mts}',
66
'integration/rstest/**/rstest.*.config.{ts,mts}',
77
],
8+
reporters: ['default'],
89
});

tests/rstest.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default defineConfig({
66
exclude: ['integration/rstest/**'],
77
globals: true,
88
retry: 1,
9+
reporters: ['default'],
910
testTimeout: 60_000,
1011
hookTimeout: 60_000,
1112
});

0 commit comments

Comments
 (0)