Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 8df79fa9
authored
Dec 16, 2017
by
Sushant
Committed by
GitHub
Dec 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: assert that where conditions are not ignored with empty include (#8790)
1 parent
ca788b7a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
test/integration/model/findAll.test.js
test/integration/model/findAll.test.js
View file @
8df79fa
...
...
@@ -53,6 +53,12 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
}
it
(
'should not crash on an empty where array'
,
function
()
{
return
this
.
User
.
findAll
({
where
:
[]
});
});
describe
(
'special where conditions/smartWhere object'
,
()
=>
{
beforeEach
(
function
()
{
this
.
buf
=
new
Buffer
(
16
);
...
...
@@ -469,13 +475,23 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
});
it
(
'should not crash on an empty where array'
,
function
()
{
return
this
.
User
.
findAll
({
where
:
[]
describe
(
'eager loading'
,
()
=>
{
it
(
'should not ignore where condition with empty includes, #8771'
,
function
()
{
return
this
.
User
.
bulkCreate
([
{
username
:
'D.E.N.N.I.S'
,
intVal
:
6
},
{
username
:
'F.R.A.N.K'
,
intVal
:
5
},
{
username
:
'W.I.L.D C.A.R.D'
,
intVal
:
8
}
]).
then
(()
=>
this
.
User
.
findAll
({
where
:
{
intVal
:
8
},
include
:
[]
})).
then
(
users
=>
{
expect
(
users
).
to
.
have
.
length
(
1
);
expect
(
users
[
0
].
get
(
'username'
)).
to
.
be
.
equal
(
'W.I.L.D C.A.R.D'
);
});
});
describe
(
'eager loading'
,
()
=>
{
describe
(
'belongsTo'
,
()
=>
{
beforeEach
(
function
()
{
const
self
=
this
;
...
...
@@ -978,7 +994,6 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
describe
(
'properly handles attributes:[] cases'
,
()
=>
{
beforeEach
(
function
()
{
this
.
Animal
=
this
.
sequelize
.
define
(
'Animal'
,
{
name
:
Sequelize
.
STRING
,
...
...
@@ -1066,7 +1081,6 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
});
});
});
});
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment