Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate tests to ava + add eslint #41

Merged
merged 9 commits into from
Feb 29, 2024
Merged

Migrate tests to ava + add eslint #41

merged 9 commits into from
Feb 29, 2024

Conversation

Amxx
Copy link
Contributor

@Amxx Amxx commented Feb 27, 2024

Includes:

  • fuzzing values + options
  • snapshot render() & dump()

@Amxx Amxx marked this pull request as ready for review February 27, 2024 20:19
@Amxx Amxx mentioned this pull request Feb 27, 2024
8 tasks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this was copied for "openzeppelin-transpiler". Just added '@typescript-eslint/no-explicit-any': 'off', because we need explicit any (in StandardMerkleTree)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we can disable it only where it's used. It's only in StandardMerkleTree and we can do:

type Leaf = any[];

export interface StandardMerkleTreeData<T extends Leaf> extends MerkleTreeData<T> {
...

This way we only disable the rule in a single place. I think we can benefit of it if it works like this

Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of comments but looks better than I thought

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we can disable it only where it's used. It's only in StandardMerkleTree and we can do:

type Leaf = any[];

export interface StandardMerkleTreeData<T extends Leaf> extends MerkleTreeData<T> {
...

This way we only disable the rule in a single place. I think we can benefit of it if it works like this

"prettier": "^3.2.5",
"rimraf": "^5.0.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is rimraf needed? I know is widely used but reducing the surface may be a better idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It replaces rm -rf .... I think its better for portability.

@Amxx
Copy link
Contributor Author

Amxx commented Feb 29, 2024

Alternatively, we can disable it only where it's used. It's only in StandardMerkleTree and we can do:

type Leaf = any[];

export interface StandardMerkleTreeData extends MerkleTreeData {
...
This way we only disable the rule in a single place. I think we can benefit of it if it works like this

There are also some any in standard.test.ts and simple.test.ts
Let merge like this an possibly change that in another PR.

@Amxx Amxx merged commit 6ab2cfb into master Feb 29, 2024
3 checks passed
@Amxx Amxx deleted the testing/fast-check-ava branch February 29, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants