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 70910476
authored
Sep 29, 2018
by
Sushant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test(mysql): remove old warning tests
1 parent
d76b0a84
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
32 deletions
test/integration/dialects/mysql/warning.test.js
test/integration/sequelize.test.js
test/integration/dialects/mysql/warning.test.js
View file @
7091047
...
@@ -22,7 +22,7 @@ describe(Support.getTestDialectTeaser('Warning'), () => {
...
@@ -22,7 +22,7 @@ describe(Support.getTestDialectTeaser('Warning'), () => {
const
Model
=
sequelize
.
define
(
'model'
,
{
const
Model
=
sequelize
.
define
(
'model'
,
{
name
:
Sequelize
.
DataTypes
.
STRING
(
1
,
true
)
name
:
Sequelize
.
DataTypes
.
STRING
(
1
,
true
)
});
});
return
sequelize
.
sync
({
force
:
true
}).
then
(()
=>
{
return
sequelize
.
sync
({
force
:
true
}).
then
(()
=>
{
return
sequelize
.
authenticate
();
return
sequelize
.
authenticate
();
}).
then
(()
=>
{
}).
then
(()
=>
{
...
@@ -40,4 +40,4 @@ describe(Support.getTestDialectTeaser('Warning'), () => {
...
@@ -40,4 +40,4 @@ describe(Support.getTestDialectTeaser('Warning'), () => {
});
});
});
});
}
}
});
});
\ No newline at end of file
\ No newline at end of file
test/integration/sequelize.test.js
View file @
7091047
...
@@ -13,10 +13,8 @@ const chai = require('chai'),
...
@@ -13,10 +13,8 @@ const chai = require('chai'),
Transaction
=
require
(
'../../lib/transaction'
),
Transaction
=
require
(
'../../lib/transaction'
),
logger
=
require
(
'../../lib/utils/logger'
),
logger
=
require
(
'../../lib/utils/logger'
),
sinon
=
require
(
'sinon'
),
sinon
=
require
(
'sinon'
),
semver
=
require
(
'semver'
),
current
=
Support
.
sequelize
;
current
=
Support
.
sequelize
;
const
qq
=
function
(
str
)
{
const
qq
=
function
(
str
)
{
if
(
dialect
===
'postgres'
||
dialect
===
'mssql'
)
{
if
(
dialect
===
'postgres'
||
dialect
===
'mssql'
)
{
return
'"'
+
str
+
'"'
;
return
'"'
+
str
+
'"'
;
...
@@ -287,33 +285,6 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
...
@@ -287,33 +285,6 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
});
});
});
});
// We can only test MySQL warnings when using MySQL.
if
(
dialect
===
'mysql'
)
{
it
(
'logs warnings when there are warnings'
,
function
()
{
// Due to strict MySQL 5.7 all cases below will throw errors rather than warnings
if
(
semver
.
gte
(
current
.
options
.
databaseVersion
,
'5.6.0'
))
{
return
;
}
const
logger
=
sinon
.
spy
();
const
sequelize
=
Support
.
createSequelizeInstance
({
logging
:
logger
,
benchmark
:
false
,
showWarnings
:
true
});
const
insertWarningQuery
=
'INSERT INTO '
+
qq
(
this
.
User
.
tableName
)
+
' (username, email_address, '
+
qq
(
'createdAt'
)
+
', '
+
qq
(
'updatedAt'
)
+
") VALUES ('john', 'john@gmail.com', 'HORSE', '2012-01-01 10:10:10')"
;
return
sequelize
.
query
(
insertWarningQuery
)
.
then
(()
=>
{
expect
(
logger
.
callCount
).
to
.
equal
(
3
);
expect
(
logger
.
args
[
2
][
0
]).
to
.
be
.
match
(
/^MySQL Warnings
\(
default
\)
:.*
?
'createdAt'/m
);
});
});
}
it
(
'executes a query with global benchmarking option and custom logger'
,
()
=>
{
it
(
'executes a query with global benchmarking option and custom logger'
,
()
=>
{
const
logger
=
sinon
.
spy
();
const
logger
=
sinon
.
spy
();
const
sequelize
=
Support
.
createSequelizeInstance
({
const
sequelize
=
Support
.
createSequelizeInstance
({
...
...
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