Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions test/types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,15 @@ expectType<void>(timer.clearOnResetCallback());
expectType<rclnodejs.TimerInfo>(timer.callTimerWithInfo());

// ---- Rate ----
const rate = await node.createRate(1);
expectType<rclnodejs.Rate>(rate);
expectType<number>(rate.frequency);
expectType<boolean>(rate.isCanceled());
expectType<Promise<void>>(rate.sleep());
expectType<void>(rate.cancel());
expectType<Promise<rclnodejs.Rate>>(node.createRate(1));
void (async () => {
const rate = await node.createRate(1);
expectType<rclnodejs.Rate>(rate);
expectType<number>(rate.frequency);
expectType<boolean>(rate.isCanceled());
expectType<Promise<void>>(rate.sleep());
expectType<void>(rate.cancel());
})();

// ---- Duration ----
const duration1 = new rclnodejs.Duration();
Expand Down
11 changes: 5 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "es2020",
/* Strict Type-Checking Options */
"module": "nodenext",
"moduleResolution": "nodenext",
"target": "es2022",
"strict": true,
/* Additional Checks */
/* next line commented out because we need unused vars for type tests */
// "noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"lib": ["es2020"]
"lib": ["es2022"],
"types": ["node"]
},
"include": [
"types/**/*"
Expand Down
Loading