Skip to content

Commit 4fcfe74

Browse files
authored
chore: Isolate documenter snapshot from the rest of tests (#3551)
1 parent bdfe392 commit 4fcfe74

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/__tests__/snapshot-tests/documenter.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
import { getAllComponents, requireComponentDefinition } from '../utils';
3+
import definitions from '../../../lib/components-definitions/components';
4+
import { getAllComponents } from '../utils';
5+
6+
function requireComponentDefinition(componentName: string) {
7+
return definitions[componentName];
8+
}
49

510
describe('Documenter', () => {
611
test.each<string>(getAllComponents())(`definition for %s matches the snapshot`, (componentName: string) => {

src/__tests__/utils.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import fs from 'fs';
55
import path from 'path';
66

77
import { SplitPanelContextProvider } from '../../lib/components/internal/context/split-panel-context';
8-
import definitions from '../../lib/components-definitions/components';
98
import { defaultSplitPanelContextProps } from './required-props-for-components';
109

1110
const componentsDir = path.resolve(__dirname, '../../lib/components');
@@ -68,10 +67,6 @@ export function requireComponent(componentName: string): any {
6867
return require(path.join(componentsDir, componentName));
6968
}
7069

71-
export function requireComponentDefinition(componentName: string) {
72-
return definitions[componentName];
73-
}
74-
7570
export function requireDesignTokensFile(fileName: string): any {
7671
// eslint-disable-next-line @typescript-eslint/no-require-imports
7772
return require(path.join(designTokensDir, fileName));

0 commit comments

Comments
 (0)