Format authored monorepo code with pinned language formatters
This commit is contained in:
@@ -5,14 +5,12 @@ import { test } from "node:test";
|
||||
|
||||
const cli = resolve(process.cwd(), "dist/src/capability-language/cli.js");
|
||||
|
||||
const runResourceCheck = (source: string) => spawnSync(
|
||||
process.execPath,
|
||||
[cli, "--resource", "--check", "-"],
|
||||
{ input: source, encoding: "utf8" },
|
||||
);
|
||||
const runResourceCheck = (source: string) =>
|
||||
spawnSync(process.execPath, [cli, "--resource", "--check", "-"], { input: source, encoding: "utf8" });
|
||||
|
||||
test("capability CLI checks a standalone interface resource", () => {
|
||||
const result = runResourceCheck(`interface WeatherBase id "interface:weather-base" revision "interface:weather-base@1" {
|
||||
const result =
|
||||
runResourceCheck(`interface WeatherBase id "interface:weather-base" revision "interface:weather-base@1" {
|
||||
value temperature id "member:weather:temperature" : double {
|
||||
get id "operation:weather:temperature:get";
|
||||
}
|
||||
@@ -22,7 +20,8 @@ test("capability CLI checks a standalone interface resource", () => {
|
||||
});
|
||||
|
||||
test("capability CLI reports invalid standalone interface members", () => {
|
||||
const result = runResourceCheck(`interface WeatherBase id "interface:weather-base" revision "interface:weather-base@1" {
|
||||
const result =
|
||||
runResourceCheck(`interface WeatherBase id "interface:weather-base" revision "interface:weather-base@1" {
|
||||
value temperature : definitely-not-a-type;
|
||||
}\n`);
|
||||
assert.notEqual(result.status, 0);
|
||||
|
||||
Reference in New Issue
Block a user