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 b05abdd4
authored
May 29, 2018
by
Sushant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chores: sinon 5
1 parent
a1f30d27
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
17 deletions
package.json
test/integration/associations/belongs-to-many.test.js
test/integration/sequelize.test.js
test/unit/associations/has-many.test.js
test/unit/hooks.test.js
test/unit/model/bulkcreate.test.js
test/unit/model/destroy.test.js
test/unit/model/findall.test.js
package.json
View file @
b05abdd
...
...
@@ -64,7 +64,7 @@
"pg-types"
:
"^1.x"
,
"rimraf"
:
"^2.x"
,
"semantic-release"
:
"^15.x"
,
"sinon"
:
"^
4.x
"
,
"sinon"
:
"^
5.0.10
"
,
"sinon-chai"
:
"^3.1.0"
,
"sqlite3"
:
"^4.x"
,
"tedious"
:
"^2.x"
,
...
...
test/integration/associations/belongs-to-many.test.js
View file @
b05abdd
...
...
@@ -1338,7 +1338,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => {
}).
return
(
user
);
}).
then
(
user
=>
{
expect
(
spy
).
to
.
have
.
been
.
calledTwice
;
spy
.
reset
();
spy
.
reset
History
();
return
Promise
.
join
(
user
,
user
.
getProjects
({
...
...
@@ -1377,14 +1377,14 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => {
return
user
.
addProject
(
project
,
{
logging
:
spy
}).
return
(
user
);
}).
then
(
user
=>
{
expect
(
spy
.
calledTwice
).
to
.
be
.
ok
;
// Once for SELECT, once for INSERT
spy
.
reset
();
spy
.
reset
History
();
return
user
.
getProjects
({
logging
:
spy
});
}).
then
(
projects
=>
{
const
project
=
projects
[
0
];
expect
(
spy
.
calledOnce
).
to
.
be
.
ok
;
spy
.
reset
();
spy
.
reset
History
();
expect
(
project
).
to
.
be
.
ok
;
return
self
.
user
.
removeProject
(
project
,
{
...
...
test/integration/sequelize.test.js
View file @
b05abdd
...
...
@@ -1147,7 +1147,7 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
it
(
'through Sequelize.sync()'
,
function
()
{
const
self
=
this
;
self
.
spy
.
reset
();
self
.
spy
.
reset
History
();
return
this
.
sequelize
.
sync
({
force
:
true
,
logging
:
false
}).
then
(()
=>
{
expect
(
self
.
spy
.
notCalled
).
to
.
be
.
true
;
});
...
...
@@ -1155,7 +1155,7 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
it
(
'through DAOFactory.sync()'
,
function
()
{
const
self
=
this
;
self
.
spy
.
reset
();
self
.
spy
.
reset
History
();
return
this
.
User
.
sync
({
force
:
true
,
logging
:
false
}).
then
(()
=>
{
expect
(
self
.
spy
.
notCalled
).
to
.
be
.
true
;
});
...
...
test/unit/associations/has-many.test.js
View file @
b05abdd
...
...
@@ -63,7 +63,7 @@ describe(Support.getTestDialectTeaser('hasMany'), () => {
]));
return
user
.
setTasks
([
task1
,
task2
]).
bind
(
this
).
then
(
function
()
{
this
.
update
.
reset
();
this
.
update
.
reset
History
();
return
user
.
setTasks
(
null
);
}).
then
(
function
()
{
expect
(
this
.
findAll
).
to
.
have
.
been
.
calledTwice
;
...
...
test/unit/hooks.test.js
View file @
b05abdd
...
...
@@ -278,8 +278,8 @@ describe(Support.getTestDialectTeaser('Hooks'), () => {
expect
(
hook1
).
to
.
have
.
been
.
calledOnce
;
expect
(
hook2
).
to
.
have
.
been
.
calledOnce
;
hook1
.
reset
();
hook2
.
reset
();
hook1
.
reset
History
();
hook2
.
reset
History
();
this
.
Model
.
removeHook
(
'beforeCreate'
,
'myHook'
);
this
.
Model
.
removeHook
(
'beforeCreate'
,
'myHook2'
);
...
...
@@ -308,10 +308,10 @@ describe(Support.getTestDialectTeaser('Hooks'), () => {
expect
(
hook3
).
to
.
have
.
been
.
calledOnce
;
expect
(
hook4
).
to
.
have
.
been
.
calledOnce
;
hook1
.
reset
();
hook2
.
reset
();
hook3
.
reset
();
hook4
.
reset
();
hook1
.
reset
History
();
hook2
.
reset
History
();
hook3
.
reset
History
();
hook4
.
reset
History
();
this
.
Model
.
removeHook
(
'beforeCreate'
,
'myHook'
);
...
...
test/unit/model/bulkcreate.test.js
View file @
b05abdd
...
...
@@ -23,7 +23,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
afterEach
(
function
()
{
this
.
stub
.
reset
();
this
.
stub
.
reset
History
();
});
after
(
function
()
{
...
...
test/unit/model/destroy.test.js
View file @
b05abdd
...
...
@@ -26,7 +26,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
beforeEach
(
function
()
{
this
.
deloptions
=
{
where
:
{
secretValue
:
'1'
}};
this
.
cloneOptions
=
_
.
clone
(
this
.
deloptions
);
this
.
stubDelete
.
reset
();
this
.
stubDelete
.
reset
History
();
});
afterEach
(
function
()
{
...
...
test/unit/model/findall.test.js
View file @
b05abdd
...
...
@@ -52,8 +52,8 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
beforeEach
(()
=>
{
this
.
stub
.
reset
();
this
.
warnOnInvalidOptionsStub
.
reset
();
this
.
stub
.
reset
History
();
this
.
warnOnInvalidOptionsStub
.
reset
History
();
});
after
(()
=>
{
...
...
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