Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OCM-Engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
xfsc
Organization Credential Manager
OCM-Engine
Merge requests
!17
Schemas and credential definitions. Refs
#9
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Schemas and credential definitions. Refs
#9
tsabolov/ocm-engine:feat/schemas-and-credentialdefs
into
main
Overview
0
Commits
16
Pipelines
0
Changes
8
Merged
Konstantin Tsabolov
requested to merge
tsabolov/ocm-engine:feat/schemas-and-credentialdefs
into
main
1 year ago
Overview
0
Commits
16
Pipelines
0
Changes
8
Expand
0
0
Merge request reports
Viewing commit
224971cf
Prev
Next
Show latest version
8 files
+
17
−
157
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
Verified
224971cf
chore(schema-manager): make use of shared health modules and response format interceptor
· 224971cf
Konstantin Tsabolov
authored
1 year ago
apps/schema-manager/src/common/__tests__/response-format.interceptor.spec.ts deleted
100644 → 0
+
0
−
49
Options
import
type
{
ExecutionContext
}
from
'
@nestjs/common
'
;
import
type
{
TestingModule
}
from
'
@nestjs/testing
'
;
import
{
Test
}
from
'
@nestjs/testing
'
;
import
{
of
}
from
'
rxjs
'
;
import
{
ResponseFormatInterceptor
}
from
'
../response-format.interceptor.js
'
;
describe
(
'
ResponseFormatInterceptor
'
,
()
=>
{
let
interceptor
:
ResponseFormatInterceptor
;
beforeEach
(
async
()
=>
{
const
module
:
TestingModule
=
await
Test
.
createTestingModule
({
providers
:
[
ResponseFormatInterceptor
],
}).
compile
();
interceptor
=
module
.
get
<
ResponseFormatInterceptor
>
(
ResponseFormatInterceptor
,
);
});
it
(
'
should be defined
'
,
()
=>
{
expect
(
interceptor
).
toBeDefined
();
expect
(
interceptor
).
toBeInstanceOf
(
ResponseFormatInterceptor
);
});
it
(
'
should intercept the request and format the response
'
,
(
done
)
=>
{
const
context
:
ExecutionContext
=
{
switchToHttp
:
()
=>
({
getResponse
:
()
=>
({
statusCode
:
200
,
}),
}),
}
as
ExecutionContext
;
const
next
=
{
handle
:
jest
.
fn
().
mockReturnValue
(
of
(
'
Hello World
'
)),
};
const
result
=
interceptor
.
intercept
(
context
,
next
);
expect
(
result
).
toBeDefined
();
expect
(
next
.
handle
).
toHaveBeenCalled
();
result
.
subscribe
((
response
)
=>
{
expect
(
response
).
toEqual
({
statusCode
:
200
,
data
:
'
Hello World
'
});
done
();
});
});
});
Loading