Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
f67d4ab8
Commit
f67d4ab8
authored
Jul 09, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint: fix
parent
24cb20d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
40 deletions
+40
-40
forge-test-names.ts
packages/contracts-bedrock/scripts/forge-test-names.ts
+40
-40
No files found.
packages/contracts-bedrock/scripts/forge-test-names.ts
View file @
f67d4ab8
...
@@ -9,51 +9,51 @@ const checks: Array<{
...
@@ -9,51 +9,51 @@ const checks: Array<{
check
:
(
parts
:
string
[])
=>
boolean
check
:
(
parts
:
string
[])
=>
boolean
error
:
string
error
:
string
}
>
=
[
}
>
=
[
{
{
error
:
'
test name parts should be in camelCase
'
,
error
:
'
test name parts should be in camelCase
'
,
check
:
(
parts
:
string
[]):
boolean
=>
{
check
:
(
parts
:
string
[]):
boolean
=>
{
return
parts
.
every
((
part
)
=>
{
return
parts
.
every
((
part
)
=>
{
return
part
[
0
]
===
part
[
0
].
toLowerCase
()
return
part
[
0
]
===
part
[
0
].
toLowerCase
()
})
})
},
},
},
{
},
error
:
{
'
test names should have either 3 or 4 parts, each separated by underscores
'
,
error
:
check
:
(
parts
:
string
[]):
boolean
=>
{
'
test names should have either 3 or 4 parts, each separated by underscores
'
,
return
parts
.
length
===
3
||
parts
.
length
===
4
check
:
(
parts
:
string
[]):
boolean
=>
{
},
return
parts
.
length
===
3
||
parts
.
length
===
4
},
},
{
},
error
:
'
test names should begin with "test", "testFuzz", or "testDiff"
'
,
{
check
:
(
parts
:
string
[]):
boolean
=>
{
error
:
'
test names should begin with "test", "testFuzz", or "testDiff"
'
,
return
[
'
test
'
,
'
testFuzz
'
,
'
testDiff
'
].
includes
(
parts
[
0
])
check
:
(
parts
:
string
[]):
boolean
=>
{
},
return
[
'
test
'
,
'
testFuzz
'
,
'
testDiff
'
].
includes
(
parts
[
0
])
},
},
{
},
error
:
{
'
test names should end with either "succeeds", "reverts", "fails", "works" or "benchmark[_num]"
'
,
error
:
check
:
(
parts
:
string
[]):
boolean
=>
{
'
test names should end with either "succeeds", "reverts", "fails", "works" or "benchmark[_num]"
'
,
return
(
check
:
(
parts
:
string
[]):
boolean
=>
{
[
'
succeeds
'
,
'
reverts
'
,
'
fails
'
,
'
benchmark
'
,
'
works
'
].
includes
(
return
(
parts
[
parts
.
length
-
1
]
[
'
succeeds
'
,
'
reverts
'
,
'
fails
'
,
'
benchmark
'
,
'
works
'
].
includes
(
)
||
parts
[
parts
.
length
-
1
]
(
parts
[
parts
.
length
-
2
]
===
'
benchmark
'
&&
)
||
!
isNaN
(
parseInt
(
parts
[
parts
.
length
-
1
],
10
)))
(
parts
[
parts
.
length
-
2
]
===
'
benchmark
'
&&
)
!
isNaN
(
parseInt
(
parts
[
parts
.
length
-
1
],
10
))
)
},
)
},
},
{
},
error
:
{
'
failure tests should have 4 parts, third part should indicate the reason for failure
'
,
error
:
check
:
(
parts
:
string
[]):
boolean
=>
{
'
failure tests should have 4 parts, third part should indicate the reason for failure
'
,
return
(
check
:
(
parts
:
string
[]):
boolean
=>
{
parts
.
length
===
4
||
return
(
!
[
'
reverts
'
,
'
fails
'
].
includes
(
parts
[
parts
.
length
-
1
])
parts
.
length
===
4
||
)
!
[
'
reverts
'
,
'
fails
'
].
includes
(
parts
[
parts
.
length
-
1
]
)
},
)
},
},
]
},
]
/**
/**
* Script for checking that all test functions are named correctly.
* Script for checking that all test functions are named correctly.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment