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 e71efc6b
authored
Feb 07, 2014
by
Thanasis Polychronakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create Error tests, fix stupid typo found by them
1 parent
158e5d19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletions
lib/sequelize.js
test/error.test.js
lib/sequelize.js
View file @
e71efc6
...
...
@@ -153,7 +153,7 @@ module.exports = (function() {
/**
* Expose Sequelize Error types
*/
Sequelize
.
prototype
.
Err
pr
=
Sequelize
.
Errp
r
=
Sequelize
.
prototype
.
Err
or
=
Sequelize
.
Erro
r
=
sequelizeErrors
.
BaseError
Sequelize
.
prototype
.
ValidationError
=
Sequelize
.
ValidationError
=
sequelizeErrors
.
ValidationError
...
...
test/error.test.js
0 → 100644
View file @
e71efc6
/* jshint camelcase: false */
var
chai
=
require
(
'chai'
)
,
expect
=
chai
.
expect
,
Support
=
require
(
__dirname
+
'/support'
)
,
Sequelize
=
Support
.
Sequelize
// , sinon = require('sinon')
chai
.
Assertion
.
includeStack
=
true
describe
.
only
(
Support
.
getTestDialectTeaser
(
"Sequelize Errors"
),
function
()
{
describe
(
'API Surface'
,
function
()
{
it
(
'Should have the Error constructors exposed'
,
function
()
{
expect
(
Sequelize
).
to
.
have
.
property
(
'Error'
)
expect
(
Sequelize
).
to
.
have
.
property
(
'ValidationError'
)
var
sequelize
=
new
Sequelize
();
expect
(
sequelize
).
to
.
have
.
property
(
'Error'
)
expect
(
sequelize
).
to
.
have
.
property
(
'ValidationError'
)
})
it
(
'Sequelize Errors instances should be instances of Error'
,
function
()
{
var
error
=
new
Sequelize
.
Error
();
var
validationError
=
new
Sequelize
.
ValidationError
();
var
sequelize
=
new
Sequelize
();
var
instError
=
new
sequelize
.
Error
();
var
instValidationError
=
new
sequelize
.
ValidationError
();
expect
(
error
).
to
.
be
.
instanceOf
(
Error
)
expect
(
validationError
).
to
.
be
.
instanceOf
(
Error
)
expect
(
instError
).
to
.
be
.
instanceOf
(
Error
)
expect
(
instValidationError
).
to
.
be
.
instanceOf
(
Error
)
})
})
})
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