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
Jonas Kristoffersen
DatabaseTest
Commits
7ac9f189
Commit
7ac9f189
authored
6 years ago
by
Jonas Kristoffersen
Browse files
Options
Downloads
Patches
Plain Diff
Boiiiii
parent
529d2a56
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#23004
passed
6 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dao/persondao.test.js
+9
-9
9 additions, 9 deletions
dao/persondao.test.js
with
9 additions
and
9 deletions
dao/persondao.test.js
+
9
−
9
View file @
7ac9f189
...
...
@@ -88,28 +88,28 @@ test("get all persons from db", done => {
personDao
.
getAll
(
callback
);
});
test
(
"
Update one
person
in
db
"
,
done
=>
{
test
(
"
get all
person
s from
db
"
,
done
=>
{
function
callback
(
status
,
data
)
{
console
.
log
(
"
Test callback: status=
"
+
status
+
"
, data
=
"
+
JSON
.
stringify
(
data
)
"
Test callback: status=
"
+
status
+
"
, data
.length=
"
+
data
.
length
);
expect
(
data
.
length
).
toBe
(
0
);
expect
(
data
.
length
).
toBe
GreaterThanOrEqual
(
2
);
done
();
}
personDao
.
updateOne
(
1
,
{
navn
:
"
Oppdatert Nilsen
"
,
alder
:
99
,
adresse
:
"
Gata 3
"
},
callback
);
personDao
.
getAll
(
callback
);
});
test
(
"
get all
person
s from
db
"
,
done
=>
{
test
(
"
Update one
person
in
db
"
,
done
=>
{
function
callback
(
status
,
data
)
{
console
.
log
(
"
Test callback: status=
"
+
status
+
"
, data
.length=
"
+
data
.
length
"
Test callback: status=
"
+
status
+
"
, data
=
"
+
JSON
.
stringify
(
data
)
);
expect
(
data
.
length
).
toBeGreaterThanOrEqual
(
2
);
expect
(
data
.
affectedRows
).
toBeGreaterThanOrEqual
(
1
);
done
();
}
personDao
.
getAll
(
callback
);
personDao
.
updateOne
(
1
,
{
navn
:
"
Oppdatert Nilsen
"
,
alder
:
99
,
adresse
:
"
Gata 3
"
},
callback
);
});
test
(
"
delete person from db
"
,
done
=>
{
...
...
@@ -120,5 +120,5 @@ test("delete person from db", done => {
expect
(
data
.
affectedRows
).
toBeGreaterThanOrEqual
(
1
);
done
();
}
personDao
.
deleteOne
(
0
,
callback
);
personDao
.
deleteOne
(
1
,
callback
);
});
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