дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
feat(run): colour the console of a Spring Boot run (#781)
Spring Boot configurations get -Dspring.output.ansi.enabled=always: the Run console renders ANSI colours, but Spring only enables them for a terminal and the process runs on pipes. A configuration that sets the property keeps its value. Co-authored-by: ntbang0901 <[email protected]>
Цей коміт міститься в:
1 джерело
95188d9f40
коміт
193e6a4840
2 files changed
+27
-1
No files matched your search
@@ -252,6 +252,21 @@ describe("java command lines", () => {
|
||||
).toEqual(["--module-path", "/m/x.jar"]);
|
||||
});
|
||||
|
||||
it("colours a Spring Boot console unless the configuration sets the property", () => {
|
||||
const boot = (args: string[]) => ({
|
||||
...applicationConfig({ className: "a.Main" }, "src/main/java/a/Main.java"),
|
||||
kind: "spring-boot" as const,
|
||||
args,
|
||||
});
|
||||
expect(resolveJavaCommand(boot(["-Xmx1g", "a.Main"]), info).args[0]).toBe("-Dspring.output.ansi.enabled=always");
|
||||
expect(resolveJavaCommand(boot(["-Dspring.output.ansi.enabled=never", "a.Main"]), info).args).toEqual([
|
||||
"-Dspring.output.ansi.enabled=never",
|
||||
"a.Main",
|
||||
]);
|
||||
const plain = applicationConfig({ className: "a.Main" }, "src/main/java/a/Main.java");
|
||||
expect(resolveJavaCommand(plain, info).args).not.toContain("-Dspring.output.ansi.enabled=always");
|
||||
});
|
||||
|
||||
it("joins arguments for java-debug and reads JDWP's port", () => {
|
||||
expect(joinJavaArgs(["a", "b c", 'q"'])).toBe('a "b c" "q\\""');
|
||||
expect(jdwpListeningPort("Listening for transport dt_socket at address: 50123")).toBe(50123);
|
||||
|
||||
Reference in new issue
Заблокувати користувача