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 949208af
authored
Apr 11, 2014
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the tests
1 parent
b5334517
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
test/sequelize/log.test.js
test/sequelize/log.test.js
View file @
949208a
...
@@ -12,10 +12,17 @@ chai.config.includeStack = true
...
@@ -12,10 +12,17 @@ chai.config.includeStack = true
describe
(
Support
.
getTestDialectTeaser
(
"Sequelize"
),
function
()
{
describe
(
Support
.
getTestDialectTeaser
(
"Sequelize"
),
function
()
{
describe
(
'log'
,
function
()
{
describe
(
'log'
,
function
()
{
beforeEach
(
function
()
{
this
.
spy
=
sinon
.
spy
(
console
,
'log'
)
})
afterEach
(
function
()
{
console
.
log
.
restore
()
})
describe
(
"with disabled logging"
,
function
()
{
describe
(
"with disabled logging"
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
this
.
sequelize
=
new
Support
.
Sequelize
(
'db'
,
'user'
,
'pw'
,
{
logging
:
false
})
this
.
sequelize
=
new
Support
.
Sequelize
(
'db'
,
'user'
,
'pw'
,
{
logging
:
false
})
this
.
spy
=
sinon
.
spy
(
console
.
log
)
})
})
it
(
"does not call the log method of the logger"
,
function
()
{
it
(
"does not call the log method of the logger"
,
function
()
{
...
@@ -27,32 +34,31 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
...
@@ -27,32 +34,31 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
describe
(
'with default logging options'
,
function
()
{
describe
(
'with default logging options'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
this
.
sequelize
=
new
Support
.
Sequelize
(
'db'
,
'user'
,
'pw'
)
this
.
sequelize
=
new
Support
.
Sequelize
(
'db'
,
'user'
,
'pw'
)
this
.
spy
=
sinon
.
spy
(
console
.
log
)
})
})
describe
(
"called with no arguments"
,
function
()
{
describe
(
"called with no arguments"
,
function
()
{
it
(
'calls the log method'
,
function
()
{
it
(
'calls the log method'
,
function
()
{
this
.
sequelize
.
log
()
this
.
sequelize
.
log
()
expect
(
this
.
spy
.
calledOnce
).
to
.
be
.
fals
e
expect
(
this
.
spy
.
calledOnce
).
to
.
be
.
tru
e
})
})
it
(
'logs an empty string as info event'
,
function
()
{
it
(
'logs an empty string as info event'
,
function
()
{
this
.
sequelize
.
log
()
this
.
sequelize
.
log
()
expect
(
this
.
spy
.
withArgs
(
''
).
calledOnce
).
to
.
be
.
fals
e
expect
(
this
.
spy
.
calledOnce
).
to
.
be
.
tru
e
})
})
})
})
describe
(
"called with one argument"
,
function
()
{
describe
(
"called with one argument"
,
function
()
{
it
(
'logs the passed string as info event'
,
function
()
{
it
(
'logs the passed string as info event'
,
function
()
{
this
.
sequelize
.
log
(
'my message'
)
this
.
sequelize
.
log
(
'my message'
)
expect
(
this
.
spy
.
withArgs
(
'my message'
).
calledOnce
).
to
.
be
.
fals
e
expect
(
this
.
spy
.
withArgs
(
'my message'
).
calledOnce
).
to
.
be
.
tru
e
})
})
})
})
describe
(
"called with more than two arguments"
,
function
()
{
describe
(
"called with more than two arguments"
,
function
()
{
it
(
"passes the arguments to the logger"
,
function
()
{
it
(
"passes the arguments to the logger"
,
function
()
{
this
.
sequelize
.
log
(
'error'
,
'my message'
,
1
,
{
a
:
1
})
this
.
sequelize
.
log
(
'error'
,
'my message'
,
1
,
{
a
:
1
})
expect
(
this
.
spy
.
withArgs
(
'error'
,
'my message'
,
1
,
{
a
:
1
}).
calledOnce
).
to
.
be
.
fals
e
expect
(
this
.
spy
.
withArgs
(
'error'
,
'my message'
,
1
,
{
a
:
1
}).
calledOnce
).
to
.
be
.
tru
e
})
})
})
})
})
})
...
...
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