Skip to content

Commit be3295e

Browse files
committed
chore(tailwind): Improve code for running Tailwind integration test (#1935)
1 parent 3b211da commit be3295e

File tree

4 files changed

+50
-37
lines changed

4 files changed

+50
-37
lines changed

packages/tailwind/integrations/integrations.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import { spawnSync } from 'node:child_process';
21
import path from 'node:path';
2+
import shell from 'shelljs';
33

44
const $ = (command: string, cwd: string = path.resolve(__dirname, '..')) => {
5-
process.stderr.write(`${cwd} $ ${command}\n`);
6-
const returns = spawnSync(command, {
7-
shell: true,
5+
const executionResult = shell.exec(command, {
86
cwd,
9-
stdio: 'inherit',
7+
fatal: true,
8+
silent: true,
109
});
10+
if (executionResult.code !== 0) {
11+
process.stdout.write(executionResult.stderr);
12+
process.stderr.write(executionResult.stderr);
13+
}
1114
expect(
12-
returns.status,
15+
executionResult.code,
1316
`Expected command "${command}" to work properly but it returned a non-zero exit code`,
1417
).toBe(0);
1518
};

packages/tailwind/integrations/vite/package-lock.json

Lines changed: 36 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tailwind/src/utils/tailwindcss/clone-element-with-inlined-styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React from 'react';
33
import type { EmailElementProps } from '../../tailwind';
44
import { sanitizeClassName } from '../compatibility/sanitize-class-name';
55
import { makeInlineStylesFor } from '../css/make-inline-styles-for';
6-
import { sanitizeNonInlinableClasses } from '../css/sanitize-non-inlinable-classes';
76
import { sanitizeDeclarations } from '../css/sanitize-declarations';
7+
import { sanitizeNonInlinableClasses } from '../css/sanitize-non-inlinable-classes';
88
import { isComponent } from '../react/is-component';
99
import type { setupTailwind } from './setup-tailwind';
1010

turbo.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
"dependsOn": ["build"],
4141
"cache": false
4242
},
43+
"@react-email/tailwind#test": {
44+
"dependsOn": ["build"],
45+
"cache": false
46+
},
4347
"test:watch": {
4448
"cache": false
4549
},

0 commit comments

Comments
 (0)