Skip to content

Commit b9c9c06

Browse files
committed
chore: siimpler comms testing
Signed-off-by: Gordon Smith <[email protected]>
1 parent 9248954 commit b9c9c06

File tree

3 files changed

+62
-19
lines changed

3 files changed

+62
-19
lines changed

packages/comms/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"name": "index.html",
3434
"request": "launch",
3535
"type": "msedge",
36-
"url": "http://localhost:5521/index.html",
36+
"url": "http://localhost:5173/index.html",
3737
"runtimeArgs": [
3838
"--disable-web-security"
3939
],

packages/comms/index.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@
3131
<h1>ESM Quick Test</h1>
3232
<div id="placeholder"></div>
3333
<script type="module">
34-
import { Workunit } from "./src/index.browser.ts";
35-
36-
Workunit.submit({ baseUrl: "http://localhost:8010" }, "hthor", "'Hello and Welcome!';")
37-
.then((wu) => {
38-
return wu.watchUntilComplete();
39-
}).then((wu) => {
40-
return wu.fetchResults().then((results) => {
41-
return results[0].fetchRows();
42-
}).then((rows) => {
43-
return wu;
44-
});
45-
}).then((wu) => {
46-
return wu.delete().then(() => wu);
47-
}).then(wu => {
48-
console.log("Deleted WU: " + wu.Wuid, wu.isDeleted());
49-
}).catch((e) => {
50-
console.error(e);
51-
});
34+
import { test } from "./tests/index.ts";
35+
test();
36+
// Workunit.submit({ baseUrl: "http://localhost:8010" }, "hthor", "'Hello and Welcome!';")
37+
// .then((wu) => {
38+
// return wu.watchUntilComplete();
39+
// }).then((wu) => {
40+
// return wu.fetchResults().then((results) => {
41+
// return results[0].fetchRows();
42+
// }).then((rows) => {
43+
// return wu;
44+
// });
45+
// }).then((wu) => {
46+
// return wu.delete().then(() => wu);
47+
// }).then(wu => {
48+
// console.log("Deleted WU: " + wu.Wuid, wu.isDeleted());
49+
// }).catch((e) => {
50+
// console.error(e);
51+
// });
5252
</script>
5353
</body>
5454

packages/comms/tests/index.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { scopedLogger } from "@hpcc-js/util";
2+
import { Workunit } from "@hpcc-js/comms";
3+
4+
const logger = scopedLogger("tests");
5+
6+
export function test() {
7+
const wu = Workunit.attach({ baseUrl: "http://localhost:8010" }, "W20250806-122131");
8+
9+
Promise.all([
10+
wu.fetchInfo({ IncludeExceptions: true }),
11+
wu.fetchDetailsNormalized({
12+
ScopeFilter: "logical:*",
13+
NestedFilter: "",
14+
PropertiesToReturn: {
15+
AllScopes: true,
16+
AllAttributes: true,
17+
AllProperties: true,
18+
AllNotes: true,
19+
AllStatistics: true,
20+
AllHints: true
21+
},
22+
ScopeOptions: {
23+
IncludeId: true,
24+
IncludeScope: true,
25+
IncludeScopeType: true,
26+
IncludeMatchedScopesInResults: true
27+
},
28+
PropertyOptions: {
29+
IncludeName: true,
30+
IncludeRawValue: true,
31+
IncludeFormatted: true,
32+
IncludeMeasure: true,
33+
IncludeCreator: false,
34+
IncludeCreatorType: false
35+
}
36+
})
37+
]).then(([info, response]) => {
38+
debugger;
39+
}).catch(e => {
40+
logger.error(e);
41+
}).finally(() => {
42+
});
43+
}

0 commit comments

Comments
 (0)