Skip to content

Commit

Permalink
chore: linter run
Browse files Browse the repository at this point in the history
  • Loading branch information
0xteddybear committed Nov 19, 2024
1 parent a76172e commit 191c8c2
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions test/unit/transformRemappings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import mock from 'mock-fs';
describe('transformRemappings', () => {
before(() => {
mock({
'remappings.txt': 'foo=bar',
'remappings.txt': 'foo=bar',
});
});
after(() => {
Expand Down Expand Up @@ -59,9 +59,15 @@ describe('transformRemappings', () => {

expect(transformedContent).to.include(`import 'some-package/Contract.sol';`);
expect(transformedContent).to.include(`import 'another-package/Token.sol';`);
expect(transformedContent).to.include(`import {FixedPointMathLib} from 'solmate/src/utils/FixedPointMathLib.sol';`);
expect(transformedContent).to.include(`import {FixedPointMathLib} from "solmate/src/utils/FixedPointMathLib.sol";`);
expect(transformedContent).to.include(`import {FixedPointMathLib as FPL} from "solmate/src/utils/FixedPointMathLib.sol";`);
expect(transformedContent).to.include(
`import {FixedPointMathLib} from 'solmate/src/utils/FixedPointMathLib.sol';`,
);
expect(transformedContent).to.include(
`import {FixedPointMathLib} from "solmate/src/utils/FixedPointMathLib.sol";`,
);
expect(transformedContent).to.include(
`import {FixedPointMathLib as FPL} from "solmate/src/utils/FixedPointMathLib.sol";`,
);
expect(transformedContent).to.include(`import * as FPL from "solmate/src/utils/FixedPointMathLib.sol";`);
});
});
Expand All @@ -85,10 +91,14 @@ describe('transformRemappings', () => {

const transformedContent = transformRemappings(fileContent);

expect(transformedContent).to.include(`import {FixedPointMathLib} from 'solmate/src/utils/FixedPointMathLib.sol';`);
expect(transformedContent).to.include(
`import {FixedPointMathLib} from 'solmate/src/utils/FixedPointMathLib.sol';`,
);
expect(transformedContent).to.include(`import 'solmate/src/utils/FixedPointMathLib.sol';`);
expect(transformedContent).to.include(`import "solmate/src/utils/FixedPointMathLib.sol";`);
expect(transformedContent).to.include(`import {FixedPointMathLib as FPL} from 'solmate/src/utils/FixedPointMathLib.sol';`);
expect(transformedContent).to.include(
`import {FixedPointMathLib as FPL} from 'solmate/src/utils/FixedPointMathLib.sol';`,
);
expect(transformedContent).to.include(`import * as FPL from "solmate/src/utils/FixedPointMathLib.sol";`);
});
});
Expand Down Expand Up @@ -128,17 +138,17 @@ describe('transformRemappings', () => {
});

it.skip('should not have false positives choosing imports', () => {

const fileContent = `
const fileContent = `
/*
import '../../../node_modules/some-package/Contract.sol';
*/
`;

const transformedContent = transformRemappings(fileContent);
const transformedContent = transformRemappings(fileContent);

expect(transformedContent).not.to.include(`import 'some-package/Contract.sol';`);
expect(transformedContent).to.include(`import '../../../node_modules/some-package/Contract.sol';`);
expect(transformedContent).not.to.include(`import 'some-package/Contract.sol';`);
expect(transformedContent).to.include(`import '../../../node_modules/some-package/Contract.sol';`);
});

it.skip('should process two imports present in a single line', () => {
const fileContent = `
Expand Down

0 comments on commit 191c8c2

Please sign in to comment.