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 68620db1
authored
May 05, 2014
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faketimers give trouble with setImmediate in 0.10. Changed to a regular settimout
1 parent
9b93aae3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
lib/dao-factory.js
test/dao.test.js
lib/dao-factory.js
View file @
68620db
...
@@ -936,7 +936,6 @@ module.exports = (function() {
...
@@ -936,7 +936,6 @@ module.exports = (function() {
DAOFactory
.
prototype
.
create
=
function
(
values
,
options
)
{
DAOFactory
.
prototype
.
create
=
function
(
values
,
options
)
{
Utils
.
validateParameter
(
values
,
Object
,
{
optional
:
true
})
Utils
.
validateParameter
(
values
,
Object
,
{
optional
:
true
})
Utils
.
validateParameter
(
options
,
Object
,
{
deprecated
:
Array
,
optional
:
true
,
index
:
2
,
method
:
'DAOFactory#create'
})
Utils
.
validateParameter
(
options
,
Object
,
{
deprecated
:
Array
,
optional
:
true
,
index
:
2
,
method
:
'DAOFactory#create'
})
if
(
options
instanceof
Array
)
{
if
(
options
instanceof
Array
)
{
options
=
{
fields
:
options
}
options
=
{
fields
:
options
}
}
}
...
...
test/dao.test.js
View file @
68620db
...
@@ -850,22 +850,22 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
...
@@ -850,22 +850,22 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
})
})
it
(
'does not update timestamps when passing silent=true'
,
function
()
{
it
(
'does not update timestamps when passing silent=true'
,
function
()
{
this
.
clock
=
sinon
.
useFakeTimers
(
new
Date
().
getTime
());
var
self
=
this
var
self
=
this
return
this
.
User
.
create
({
username
:
'user'
}).
then
(
function
(
user
)
{
return
this
.
User
.
create
({
username
:
'user'
}).
then
(
function
(
user
)
{
var
updatedAt
=
user
.
updatedAt
var
updatedAt
=
user
.
updatedAt
self
.
clock
.
tick
(
30000
);
return
new
self
.
sequelize
.
Promise
(
function
(
resolve
)
{
setTimeout
(
function
()
{
return
user
.
updateAttributes
({
user
.
updateAttributes
({
username
:
'userman'
username
:
'userman'
},
{
},
{
silent
:
true
//
silent: true
}).
then
(
function
()
{
}).
then
(
function
()
{
expect
(
user
.
updatedAt
).
to
.
equalDate
(
updatedAt
)
expect
(
user
.
updatedAt
).
to
.
equalDate
(
updatedAt
)
self
.
clock
.
restore
();
resolve
()
})
},
2000
)
})
})
})
})
})
})
...
...
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