Skip to content

Commit

Permalink
fix: Remove act from selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
georgylobko committed Jul 31, 2024
1 parent c19106e commit 7f2afa0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/converter/convert-to-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { transformSync, types, PluginObj, NodePath } from '@babel/core';

const runtimeSelectorsPath = '@cloudscape-design/test-utils-core/selectors';
const ourWrappers = ['ElementWrapper', 'ComponentWrapper'];
const utilsPaths = '@cloudscape-design/test-utils-core/utils';

interface PluginArguments {
types: typeof types;
Expand All @@ -28,6 +29,14 @@ function selectorUtilsGenerator({ types: t }: PluginArguments): PluginObj {
.filter(spec => spec.node.local.name === 'usesDom')
.forEach(spec => spec.remove());
}

// Remove act
if (source.node.value === utilsPaths) {
path

Check warning on line 35 in src/converter/convert-to-selectors.ts

View check run for this annotation

Codecov / codecov/patch

src/converter/convert-to-selectors.ts#L35

Added line #L35 was not covered by tests
.get('specifiers')
.filter(spec => spec.node.local.name === 'act')
.forEach(spec => spec.remove());

Check warning on line 38 in src/converter/convert-to-selectors.ts

View check run for this annotation

Codecov / codecov/patch

src/converter/convert-to-selectors.ts#L37-L38

Added lines #L37 - L38 were not covered by tests
}
},
ClassDeclaration(path: NodePath<types.ClassDeclaration>) {
// our wrapper classes have generic parameters only in DOM version
Expand Down

0 comments on commit 7f2afa0

Please sign in to comment.