Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DatabaseTest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Magomed Khatujevitsj Bakhmadov
DatabaseTest
Commits
e6705e40
Commit
e6705e40
authored
6 years ago
by
Magomed Khatujevitsj Bakhmadov
Browse files
Options
Downloads
Patches
Plain Diff
Update persondao.test.js
parent
1b744c18
No related branches found
No related tags found
No related merge requests found
Pipeline
#22887
failed
6 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dao/persondao.test.js
+25
-0
25 additions, 0 deletions
dao/persondao.test.js
with
25 additions
and
0 deletions
dao/persondao.test.js
+
25
−
0
View file @
e6705e40
...
@@ -26,6 +26,31 @@ afterAll(() => {
...
@@ -26,6 +26,31 @@ afterAll(() => {
pool
.
end
();
pool
.
end
();
});
});
test
(
"
delete one person from db
"
,
done
=>
{
function
callback
(
err
,
rows
)
{
expect
(
affectedRows
.
length
).
toBe
(
rows
.
length
-
1
);
done
();
}
personDao
.
deleteOne
(
1
,
callback
);
});
test
(
"
update on person from db
"
,
done
=>
{
function
callback
(
status
,
data
)
{
console
.
log
(
"
Test callback: status=
"
+
status
+
"
, data=
"
+
JSON
.
stringify
(
data
)
);
expect
(
data
[
0
].
navn
).
toBe
(
"
Magomed Bakhmadov
"
);
expect
(
data
[
0
].
adresse
).
toBe
(
"
Odd Brochmanns veg 1
"
);
expect
(
data
[
0
]).
alder
.
toBe
(
20
);
done
();
}
personDao
.
updateOne
(
1
,
{
navn
:
"
Magomed Bakhmadov
"
,
adresse
:
"
Odd Brochmanns veg 1
"
,
alder
:
20
},
callback
);
});
test
(
"
get one person from db
"
,
done
=>
{
test
(
"
get one person from db
"
,
done
=>
{
function
callback
(
status
,
data
)
{
function
callback
(
status
,
data
)
{
console
.
log
(
console
.
log
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment