Repository navigation
Expand file tree
/
Copy pathdev-stop.test.mjs
More file actions
59 lines (56 loc) · 1.72 KB
/
Copy pathdev-stop.test.mjs
File metadata and controls
59 lines (56 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import assert from "node:assert/strict";
import test from "node:test";
import {
isRepositoryApiWatcherCommand,
parsePosixProcessList,
} from "./dev-stop.mjs";
test("recognizes the repository API dotnet watcher", () => {
assert.equal(
isRepositoryApiWatcherCommand(
"dotnet watch --project apps/api/Source/Modules/GameGuild.Other/Other.csproj run",
),
false,
);
assert.equal(
isRepositoryApiWatcherCommand(
"dotnet watch --project apps/api/Source/GameGuild.API/GameGuild.API.csproj run --urls http://localhost:8080",
),
true,
);
assert.equal(
isRepositoryApiWatcherCommand(
"/usr/bin/dotnet watch --project /workspace/apps/api/Source/GameGuild.API/GameGuild.API.csproj run",
),
true,
);
});
test("recognizes the dotnet watch tool child without selecting other workers", () => {
assert.equal(
isRepositoryApiWatcherCommand(
"/usr/share/dotnet/dotnet /usr/share/dotnet/sdk/10.0.401/DotnetTools/dotnet-watch/10.0.401/tools/net10.0/any/dotnet-watch.dll --project apps/api/Source/GameGuild.API/GameGuild.API.csproj run",
),
true,
);
assert.equal(
isRepositoryApiWatcherCommand(
"/usr/share/dotnet/dotnet /usr/share/dotnet/sdk/10.0.401/MSBuild.dll /nologo /nodemode:1",
),
false,
);
});
test("parses POSIX process groups without truncating commands", () => {
assert.deepEqual(
parsePosixProcessList(
" 837568 1689 837568 dotnet watch --project apps/api/Source/GameGuild.API/GameGuild.API.csproj run\n",
),
[
{
pid: 837568,
parentPid: 1689,
processGroupId: 837568,
command:
"dotnet watch --project apps/api/Source/GameGuild.API/GameGuild.API.csproj run",
},
],
);
});