Skip to content

Commit 80ce103

Browse files
authored
Merge branch 'main' into empty-legend-bug
2 parents e2f6729 + e2fe5c2 commit 80ce103

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

src/__tests__/documenter.test.ts

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import fs from "fs";
54
import path from "node:path";
6-
import os from "os";
75
import { expect, test } from "vitest";
86

9-
import { writeComponentsDocumentation } from "@cloudscape-design/documenter";
7+
import { documentComponents } from "@cloudscape-design/documenter";
108

119
import componentDefinitions from "../../lib/components/internal/api-docs/components";
1210
import { getAllComponents } from "./utils";
@@ -16,22 +14,11 @@ test.each<string>(getAllComponents())(`definition for %s matches the snapshot`,
1614
expect(definition).toMatchSnapshot(componentName);
1715
});
1816

19-
test("internal core API matches snapshot", () => {
20-
const tmpDir = path.join(os.tmpdir(), `core-chart-docs-${Date.now()}`);
21-
fs.mkdirSync(tmpDir, { recursive: true });
22-
try {
23-
writeComponentsDocumentation({
24-
outDir: tmpDir,
25-
tsconfigPath: path.resolve("tsconfig.json"),
26-
publicFilesGlob: "src/internal-do-not-use/core-chart/index.tsx",
27-
});
28-
29-
const outputPath = path.join(tmpDir, "core-chart.js");
30-
expect(fs.existsSync(outputPath)).toBe(true);
31-
32-
const definition = fs.readFileSync(outputPath, "utf-8");
33-
expect(definition).toMatchSnapshot("internal-core-chart");
34-
} finally {
35-
fs.rmSync(tmpDir, { recursive: true, force: true });
36-
}
37-
}, 10000);
17+
// Skipped until a bug in documenter is fixed.
18+
test.skip("internal core API matches snapshot", () => {
19+
const definitions = documentComponents({
20+
tsconfigPath: path.resolve("tsconfig.json"),
21+
publicFilesGlob: "src/internal-do-not-use/core-chart/index.tsx",
22+
});
23+
expect(definitions).toMatchSnapshot("internal-core-chart");
24+
});

0 commit comments

Comments
 (0)