Skip to content

Commit

Permalink
refactor: move component wise codemod logic into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jan 11, 2024
1 parent d8b1fe6 commit 587e180
Show file tree
Hide file tree
Showing 9 changed files with 716 additions and 664 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path';
import { applyTransform } from '@hypermod/utils';
import * as transformer from '..';
import { red } from '../utils';

it('should update the lineHeight & fontSize tokens', async () => {
const result = await applyTransform(
Expand Down Expand Up @@ -307,18 +308,18 @@ it('should correctly convert Title to Heading component', async () => {

expect(consoleSpy).toHaveBeenNthCalledWith(
1,
transformer.red('\n⛔️ Expression found in the "size" attribute, please update manually:'),
transformer.red(`${path.resolve(__dirname, __filename)}:11:10\n`),
red('\n⛔️ Expression found in the "size" attribute, please update manually:'),
red(`${path.resolve(__dirname, __filename)}:11:10\n`),
);
expect(consoleSpy).toHaveBeenNthCalledWith(
2,
transformer.red('\n⛔️ Expression found in the "size" attribute, please update manually:'),
transformer.red(`${path.resolve(__dirname, __filename)}:18:10\n`),
red('\n⛔️ Expression found in the "size" attribute, please update manually:'),
red(`${path.resolve(__dirname, __filename)}:18:10\n`),
);
expect(consoleSpy).toHaveBeenNthCalledWith(
3,
transformer.red('\n⛔️ Expression found in the "size" attribute, please update manually:'),
transformer.red(`${path.resolve(__dirname, __filename)}:18:84\n`),
red('\n⛔️ Expression found in the "size" attribute, please update manually:'),
red(`${path.resolve(__dirname, __filename)}:18:84\n`),
);

expect(result).toMatchInlineSnapshot(`
Expand Down
Loading

0 comments on commit 587e180

Please sign in to comment.