-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
181 changed files
with
4,818 additions
and
3,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ | |
"private": false, | ||
"arguments": [], | ||
"meta": { | ||
"tags": [ | ||
"ethers.js" | ||
] | ||
"tags": ["ethers.js"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,48 @@ | ||
import { describe, it } from 'vitest'; | ||
import jscodeshift, { type API } from 'jscodeshift'; | ||
import transform from '../src/index.js'; | ||
import assert from 'node:assert'; | ||
import { readFile } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import assert from "node:assert"; | ||
import { readFile } from "node:fs/promises"; | ||
import { join } from "node:path"; | ||
import jscodeshift, { type API } from "jscodeshift"; | ||
import { describe, it } from "vitest"; | ||
import transform from "../src/index.js"; | ||
|
||
const buildApi = (parser: string | undefined): API => ({ | ||
j: parser ? jscodeshift.withParser(parser) : jscodeshift, | ||
jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, | ||
stats: () => { | ||
console.error( | ||
'The stats function was called, which is not supported on purpose', | ||
"The stats function was called, which is not supported on purpose", | ||
); | ||
}, | ||
report: () => { | ||
console.error( | ||
'The report function was called, which is not supported on purpose', | ||
"The report function was called, which is not supported on purpose", | ||
); | ||
}, | ||
}); | ||
|
||
describe('ethereumjs/1/big-number-to-big-int-and-operator-transformations', () => { | ||
it('test #1', async () => { | ||
const INPUT = await readFile(join(__dirname, '..', '__testfixtures__/fixture1.input.ts'), 'utf-8'); | ||
const OUTPUT = await readFile(join(__dirname, '..', '__testfixtures__/fixture1.output.ts'), 'utf-8'); | ||
describe("ethereumjs/1/big-number-to-big-int-and-operator-transformations", () => { | ||
it("test #1", async () => { | ||
const INPUT = await readFile( | ||
join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), | ||
"utf-8", | ||
); | ||
const OUTPUT = await readFile( | ||
join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), | ||
"utf-8", | ||
); | ||
|
||
const actualOutput = transform({ | ||
path: 'index.js', | ||
const actualOutput = transform( | ||
{ | ||
path: "index.js", | ||
source: INPUT, | ||
}, | ||
buildApi('tsx'), {} | ||
buildApi("tsx"), | ||
{}, | ||
); | ||
|
||
assert.deepEqual( | ||
Check failure on line 43 in packages/codemods/ethers/v6/big-numbers/test/test.ts GitHub Actions / Run unit tests (ubuntu-latest, true)packages/codemods/ethers/v6/big-numbers/test/test.ts > ethereumjs/1/big-number-to-big-int-and-operator-transformations > test #1
|
||
actualOutput?.replace(/W/gm, ''), | ||
OUTPUT.replace(/W/gm, ''), | ||
actualOutput?.replace(/W/gm, ""), | ||
OUTPUT.replace(/W/gm, ""), | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { configDefaults, defineConfig } from 'vitest/config'; | ||
import { configDefaults, defineConfig } from "vitest/config"; | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: [...configDefaults.include, '**/test/*.ts'], | ||
include: [...configDefaults.include, "**/test/*.ts"], | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 26 additions & 18 deletions
44
packages/codemods/ethers/v6/contracts-ambiguous-methods/test/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,48 @@ | ||
import { describe, it } from 'vitest'; | ||
import jscodeshift, { type API } from 'jscodeshift'; | ||
import transform from '../src/index.js'; | ||
import assert from 'node:assert'; | ||
import { readFile } from 'node:fs/promises'; | ||
import { join } from 'node:path'; | ||
import assert from "node:assert"; | ||
import { readFile } from "node:fs/promises"; | ||
import { join } from "node:path"; | ||
import jscodeshift, { type API } from "jscodeshift"; | ||
import { describe, it } from "vitest"; | ||
import transform from "../src/index.js"; | ||
|
||
const buildApi = (parser: string | undefined): API => ({ | ||
j: parser ? jscodeshift.withParser(parser) : jscodeshift, | ||
jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, | ||
stats: () => { | ||
console.error( | ||
'The stats function was called, which is not supported on purpose', | ||
"The stats function was called, which is not supported on purpose", | ||
); | ||
}, | ||
report: () => { | ||
console.error( | ||
'The report function was called, which is not supported on purpose', | ||
"The report function was called, which is not supported on purpose", | ||
); | ||
}, | ||
}); | ||
|
||
describe('contract-to-typed-address-wrapper', () => { | ||
it('test #1', async () => { | ||
const INPUT = await readFile(join(__dirname, '..', '__testfixtures__/fixture1.input.ts'), 'utf-8'); | ||
const OUTPUT = await readFile(join(__dirname, '..', '__testfixtures__/fixture1.output.ts'), 'utf-8'); | ||
describe("contract-to-typed-address-wrapper", () => { | ||
it("test #1", async () => { | ||
const INPUT = await readFile( | ||
join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), | ||
"utf-8", | ||
); | ||
const OUTPUT = await readFile( | ||
join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), | ||
"utf-8", | ||
); | ||
|
||
const actualOutput = transform({ | ||
path: 'index.js', | ||
const actualOutput = transform( | ||
{ | ||
path: "index.js", | ||
source: INPUT, | ||
}, | ||
buildApi('tsx'), {} | ||
buildApi("tsx"), | ||
{}, | ||
); | ||
|
||
assert.deepEqual( | ||
actualOutput?.replace(/W/gm, ''), | ||
OUTPUT.replace(/W/gm, ''), | ||
actualOutput?.replace(/W/gm, ""), | ||
OUTPUT.replace(/W/gm, ""), | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.