-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,16 @@ | |
*/ | ||
// deno-lint-ignore-file no-explicit-any | ||
import * as path from "https://deno.land/[email protected]/path/mod.ts"; | ||
import { rgb24 } from "https://deno.land/[email protected]/fmt/colors.ts"; | ||
import { rgb24, yellow } from "https://deno.land/[email protected]/fmt/colors.ts"; | ||
import { check, jsopts } from "./mod.ts"; | ||
import { | ||
compare, | ||
Deferred, | ||
deferred, | ||
delay, | ||
extend, | ||
nuid, | ||
parseSemVer, | ||
timeout, | ||
} from "../../nats-base-client/internal_mod.ts"; | ||
|
||
|
@@ -621,6 +623,19 @@ export class NatsServer implements PortInfo { | |
throw err; | ||
} | ||
} | ||
|
||
async notCompatible(version = "2.3.3"): Promise<boolean> { | ||
const varz = await this.varz() as unknown as Record<string, string>; | ||
const sv = parseSemVer(varz.version); | ||
if (compare(sv, parseSemVer(version)) < 0) { | ||
const m = new TextEncoder().encode(yellow( | ||
`skipping test as server (${varz.version}) doesn't implement required feature from ${version} `, | ||
)); | ||
await Deno.stdout.write(m); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
|
||
// @ts-ignore: any is exactly what we need here | ||
|