Skip to content

Commit

Permalink
[TypeSpecRequirement] Format document in tests (#30668)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder authored Sep 20, 2024
1 parent 46b3863 commit b88e6ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions eng/tools/typespec-requirement/test/typespec-requirement.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { execa } from 'execa';
import { join } from 'path';
import { test } from 'vitest';
import { execa } from "execa";
import { join } from "path";
import { test } from "vitest";

async function checkAllUnder(path: string, responseCache?: string) {
const repoRoot = join(__dirname, '..', '..', '..', '..');
const script = join('eng', 'scripts', 'TypeSpec-Requirement.ps1');
const repoRoot = join(__dirname, "..", "..", "..", "..");
const script = join("eng", "scripts", "TypeSpec-Requirement.ps1");

let command = `${script} -CheckAllUnder ${join(__dirname, path)}`;
if (responseCache) {
Expand Down Expand Up @@ -52,7 +52,7 @@ test.concurrent("Generated from TypeSpec", async ({ expect }) => {
test.concurrent("Hand-written, exists in main", async ({ expect }) => {
const { stdout, exitCode } = await checkAllUnder(
"specification/hand-written",
'@{"https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hand-written/resource-manager/Microsoft.HandWritten/stable"=200}'
'@{"https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hand-written/resource-manager/Microsoft.HandWritten/stable"=200}',
);

expect(stdout).toContain("was not generated from TypeSpec");
Expand All @@ -63,7 +63,7 @@ test.concurrent("Hand-written, exists in main", async ({ expect }) => {
test.concurrent("Hand-written, does not exist in main", async ({ expect }) => {
const { stdout, exitCode } = await checkAllUnder(
"specification/hand-written",
'@{"https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hand-written/resource-manager/Microsoft.HandWritten/stable"=404}'
'@{"https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hand-written/resource-manager/Microsoft.HandWritten/stable"=404}',
);

expect(stdout).toContain("was not generated from TypeSpec");
Expand All @@ -74,7 +74,7 @@ test.concurrent("Hand-written, does not exist in main", async ({ expect }) => {
test.concurrent("Hand-written, unexpected response checking main", async ({ expect }) => {
const { stdout, stderr, exitCode } = await checkAllUnder(
"specification/hand-written",
'@{"https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hand-written/resource-manager/Microsoft.HandWritten/stable"=519}'
'@{"https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hand-written/resource-manager/Microsoft.HandWritten/stable"=519}',
);

expect(stdout).toContain("was not generated from TypeSpec");
Expand Down

0 comments on commit b88e6ad

Please sign in to comment.