Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-decorators
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
koishi-decorators
Commits
81886ff8
Commit
81886ff8
authored
Mar 10, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests
parent
080bdb45
Pipeline
#10517
passed with stages
in 1 minute and 18 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tests/top-level.spec.ts
tests/top-level.spec.ts
+4
-4
No files found.
tests/top-level.spec.ts
View file @
81886ff8
...
...
@@ -2,14 +2,14 @@ import { TopLevelAction } from '../src/decorators';
import
{
Registrar
}
from
'
../src/register
'
;
import
{
App
}
from
'
koishi
'
;
@
TopLevelAction
((
ctx
,
o
)
=>
(
o
.
foo
=
1
))
@
TopLevelAction
((
ctx
,
o
)
=>
(
o
.
bar
=
2
))
@
TopLevelAction
((
ctx
,
o
)
=>
(
o
.
foo
+
=
1
))
@
TopLevelAction
((
ctx
,
o
)
=>
(
o
.
bar
+
=
2
))
class
MyClass
{
foo
=
0
;
bar
=
0
;
}
@
TopLevelAction
((
ctx
,
o
)
=>
(
o
.
baz
=
3
))
@
TopLevelAction
((
ctx
,
o
)
=>
(
o
.
baz
+
=
3
))
class
MyAnotherClass
extends
MyClass
{
baz
=
0
;
}
...
...
@@ -31,7 +31,7 @@ describe('Top level action', () => {
it
(
'
should be applied to the class and its subclasses
'
,
()
=>
{
const
instance
=
new
MyAnotherClass
();
const
registrar
=
new
Registrar
(
instance
);
const
registrar
=
new
Registrar
(
instance
,
MyClass
);
const
app
=
new
App
();
registrar
.
performTopActions
(
app
);
expect
(
instance
.
foo
).
toBe
(
1
);
...
...
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