Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
typed-reflector
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
0
Merge Requests
0
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
typed-reflector
Commits
c5b455ac
Commit
c5b455ac
authored
Feb 13, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more unit tests
parent
c460ec1c
Pipeline
#9472
passed with stages
in 1 minute and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
tests/reflect.spec.ts
tests/reflect.spec.ts
+23
-0
No files found.
tests/reflect.spec.ts
View file @
c5b455ac
...
...
@@ -143,6 +143,9 @@ describe('Reflector', () => {
const
b
=
new
B
();
const
noop
=
new
Noop
();
expect
(
reflector
.
get
(
'
foo
'
,
A
)).
toEqual
(
'
first
'
);
expect
(
reflector
.
get
(
'
foo
'
,
a
)).
toEqual
(
'
first
'
);
expect
(
reflector
.
get
(
'
foo
'
,
B
)).
toEqual
(
'
first
'
);
expect
(
reflector
.
get
(
'
foo
'
,
b
)).
toEqual
(
'
first
'
);
expect
(
reflector
.
get
(
'
foo
'
,
a
,
'
b
'
)).
toEqual
(
'
second
'
);
expect
(
reflector
.
get
(
'
foo
'
,
A
,
'
b
'
)).
toEqual
(
'
second
'
);
expect
(
reflector
.
get
(
'
foo
'
,
B
,
'
b
'
)).
toEqual
(
'
third
'
);
...
...
@@ -154,4 +157,24 @@ describe('Reflector', () => {
expect
(
reflector
.
get
(
'
foo
'
,
Object
,
'
b
'
)).
toBeUndefined
();
expect
(
reflector
.
get
(
'
foo
'
,
Function
,
'
b
'
)).
toBeUndefined
();
});
it
(
'
should inherit the keys on inherited class
'
,
()
=>
{
class
A
{
@
Metadata
.
set
(
'
foo
'
,
'
first
'
,
'
keys
'
)
public
a
:
string
;
}
class
B
extends
A
{
@
Metadata
.
set
(
'
foo
'
,
'
second
'
,
'
keys
'
)
public
b
:
string
;
}
const
a
=
new
A
();
const
b
=
new
B
();
expect
(
reflector
.
get
(
'
keys
'
,
A
)).
toEqual
([
'
a
'
,
'
b
'
]);
expect
(
reflector
.
get
(
'
keys
'
,
a
)).
toEqual
([
'
a
'
,
'
b
'
]);
expect
(
reflector
.
get
(
'
keys
'
,
B
)).
toEqual
([
'
a
'
,
'
b
'
]);
expect
(
reflector
.
get
(
'
keys
'
,
b
)).
toEqual
([
'
a
'
,
'
b
'
]);
});
});
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