Skip to content

Commit

Permalink
refactor: Added integration tests (rename-tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Jul 28, 2023
1 parent 88b4995 commit 111d24a
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/steps/rename-tests/edge-cases.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
assertFixture,
convertFixtureToJson,
loadFixture,
test,
} from '@codemod-utils/tests';

import { renameTests } from '../../../src/steps/index.js';
import {
codemodOptions,
options,
} from '../../helpers/shared-test-setups/sample-project.js';

test('steps | rename-tests > edge-cases', function () {
const inputProject = convertFixtureToJson(
'steps/rename-tests/edge-cases/input',
);

const outputProject = convertFixtureToJson(
'steps/rename-tests/edge-cases/output',
);

loadFixture(inputProject, codemodOptions);

renameTests(options);

assertFixture(outputProject, codemodOptions);
});
28 changes: 28 additions & 0 deletions tests/steps/rename-tests/javascript.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
assertFixture,
convertFixtureToJson,
loadFixture,
test,
} from '@codemod-utils/tests';

import { renameTests } from '../../../src/steps/index.js';
import {
codemodOptions,
options,
} from '../../helpers/shared-test-setups/sample-project.js';

test('steps | rename-tests > javascript', function () {
const inputProject = convertFixtureToJson(
'steps/rename-tests/javascript/input',
);

const outputProject = convertFixtureToJson(
'steps/rename-tests/javascript/output',
);

loadFixture(inputProject, codemodOptions);

renameTests(options);

assertFixture(outputProject, codemodOptions);
});
28 changes: 28 additions & 0 deletions tests/steps/rename-tests/typescript.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
assertFixture,
convertFixtureToJson,
loadFixture,
test,
} from '@codemod-utils/tests';

import { renameTests } from '../../../src/steps/index.js';
import {
codemodOptions,
options,
} from '../../helpers/shared-test-setups/sample-project.js';

test('steps | rename-tests > typescript', function () {
const inputProject = convertFixtureToJson(
'steps/rename-tests/typescript/input',
);

const outputProject = convertFixtureToJson(
'steps/rename-tests/typescript/output',
);

loadFixture(inputProject, codemodOptions);

renameTests(options);

assertFixture(outputProject, codemodOptions);
});

0 comments on commit 111d24a

Please sign in to comment.