Skip to content

Commit

Permalink
remove prettier versioning tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed May 14, 2024
1 parent 41a77c8 commit 4fbdecf
Showing 1 changed file with 4 additions and 52 deletions.
56 changes: 4 additions & 52 deletions code/core/src/common/utils/formatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,8 @@ describe('formatter', () => {
describe('withPrettierConfig', () => {
const testPath = path.resolve(__dirname, '__tests-formatter__', 'withPrettierConfig');

describe('prettier-v2', async () => {
const prettierV2 = await import('prettier-v2');

it('formats content with prettier', async () => {
mockPrettier.format.mockImplementation(prettierV2.format);
mockPrettier.version.mockReturnValue(prettierV2.version);
mockPrettier.resolveConfig.mockImplementation(prettierV2.resolveConfig);

const filePath = path.resolve(testPath, 'testFile.ts');

const result = await formatFileContent(filePath, dummyContent);

expect(result).toMatchSnapshot();
});
});

describe('prettier-v3', async () => {
const prettierV3 = await import('prettier-v3');
describe('prettier', async () => {
const prettierV3 = await import('prettier');

it('formats content with prettier', async () => {
mockPrettier.format.mockImplementation(prettierV3.format);
Expand Down Expand Up @@ -84,24 +68,8 @@ describe('formatter', () => {
describe('withoutPrettierConfigAndWithEditorConfig', () => {
const testPath = path.resolve(__dirname, '__tests-formatter__', 'withoutPrettierConfig');

describe('prettier-v2', async () => {
const prettierV2 = await import('prettier-v2');

it('formats content with prettier', async () => {
mockPrettier.format.mockImplementation(prettierV2.format);
mockPrettier.version.mockReturnValue(prettierV2.version);
mockPrettier.resolveConfig.mockImplementation(prettierV2.resolveConfig);

const filePath = path.resolve(testPath, 'testFile.ts');

const result = await formatFileContent(filePath, dummyContent);

expect(result).toMatchSnapshot();
});
});

describe('prettier-v3', async () => {
const prettierV3 = await import('prettier-v3');
const prettierV3 = await import('prettier');

it('formats content with prettier', async () => {
mockPrettier.format.mockImplementation(prettierV3.format);
Expand Down Expand Up @@ -134,24 +102,8 @@ describe('formatter', () => {
describe('withoutPrettierConfigAndWithEditorConfig', () => {
const testPath = path.resolve(__dirname, '__tests-formatter__', 'withoutEditorConfig');

describe('prettier-v2', async () => {
const prettierV2 = await import('prettier-v2');

it('formats content with prettier', async () => {
mockPrettier.format.mockImplementation(prettierV2.format);
mockPrettier.version.mockReturnValue(prettierV2.version);
mockPrettier.resolveConfig.mockResolvedValue(null);

const filePath = path.resolve(testPath, 'testFile.ts');

const result = await formatFileContent(filePath, dummyContent);

expect(result).toBe(dummyContent);
});
});

describe('prettier-v3', async () => {
const prettierV3 = await import('prettier-v3');
const prettierV3 = await import('prettier');

it('formats content with prettier', async () => {
mockPrettier.format.mockImplementation(prettierV3.format);
Expand Down

0 comments on commit 4fbdecf

Please sign in to comment.