Skip to content

Commit e1b5bb1

Browse files
fix: (node:50743) [DEP0190] DeprecationWarning (#1608)
* fix node deprecation warning * add changeset * test(Datepicker): fix disabled button check in tests
1 parent 66abdf0 commit e1b5bb1

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.changeset/plenty-apes-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"flowbite-react": patch
3+
---
4+
5+
fix: (node:50743) [DEP0190] DeprecationWarning

bun.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
},
111111
"packages/ui": {
112112
"name": "flowbite-react",
113-
"version": "0.12.3",
113+
"version": "0.12.4",
114114
"bin": {
115115
"flowbite-react": "./dist/cli/bin.js",
116116
},

packages/ui/src/cli/utils/exec-command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { spawn, type SpawnOptions } from "child_process";
22

33
/**
4-
* Runs a shell command asynchronously and captures its output.
4+
* Runs a command asynchronously and captures its output.
55
*
66
* @param {string} command - The command to execute (e.g., "npm").
77
* @param {string[]} [args=[]] - Arguments for the command (e.g., ["install", "package-name"]).
@@ -15,7 +15,7 @@ export function execCommand(
1515
options: SpawnOptions = {},
1616
): Promise<{ stdout: string; stderr: string; exitCode: number }> {
1717
return new Promise((resolve, reject) => {
18-
const child = spawn(command, args, { ...options, shell: true });
18+
const child = spawn(command, args, options);
1919

2020
let stdout = "";
2121
let stderr = "";

packages/ui/src/components/Datepicker/Datepicker.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ describe("Components / Datepicker", () => {
200200

201201
await userEvent.click(screen.getByRole("textbox"));
202202

203-
expect(screen.getByText(tomorrow.getDate())).toBeDisabled();
203+
const dateButtons = screen.getAllByText(tomorrow.getDate().toString());
204+
const disabledButton = dateButtons.find((button) => button.hasAttribute("disabled"));
205+
expect(disabledButton).toBeInTheDocument();
206+
expect(disabledButton).toBeDisabled();
204207
});
205208

206209
it("should focus the input when ref.current.focus is called", () => {

0 commit comments

Comments
 (0)