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 a0fcd826
authored
Aug 27, 2016
by
Felix Becker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Babel devDependency
1 parent
aa00d74f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
12 deletions
lib/sequelize.js
package.json
test/integration/assets/es6project.es6 → test/integration/assets/es6project.js
test/integration/sequelize.test.js
lib/sequelize.js
View file @
a0fcd82
...
@@ -684,9 +684,9 @@ Sequelize.prototype.import = function(path) {
...
@@ -684,9 +684,9 @@ Sequelize.prototype.import = function(path) {
if
(
!
this
.
importCache
[
path
])
{
if
(
!
this
.
importCache
[
path
])
{
var
defineCall
=
(
arguments
.
length
>
1
?
arguments
[
1
]
:
require
(
path
));
var
defineCall
=
(
arguments
.
length
>
1
?
arguments
[
1
]
:
require
(
path
));
if
(
typeof
defineCall
===
'object'
&&
defineCall
.
__esModule
)
{
if
(
typeof
defineCall
===
'object'
)
{
// Babel/ES6 module compatability
// Babel/ES6 module compatability
defineCall
=
defineCall
[
'default'
]
;
defineCall
=
defineCall
.
default
;
}
}
this
.
importCache
[
path
]
=
defineCall
(
this
,
DataTypes
);
this
.
importCache
[
path
]
=
defineCall
(
this
,
DataTypes
);
}
}
...
...
package.json
View file @
a0fcd82
...
@@ -50,8 +50,6 @@
...
@@ -50,8 +50,6 @@
"wkx"
:
"0.2.0"
"wkx"
:
"0.2.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"babel-core"
:
"^6.8.0"
,
"babel-preset-es2015"
:
"^6.6.0"
,
"chai"
:
"^3.5.0"
,
"chai"
:
"^3.5.0"
,
"chai-as-promised"
:
"^5.1.0"
,
"chai-as-promised"
:
"^5.1.0"
,
"chai-datetime"
:
"^1.4.0"
,
"chai-datetime"
:
"^1.4.0"
,
...
...
test/integration/assets/es6project.
es6
→
test/integration/assets/es6project.
js
View file @
a0fcd82
export default function(sequelize, DataTypes) {
'use strict'
;
exports
.
default
=
function
(
sequelize
,
DataTypes
)
{
return
sequelize
.
define
(
'Project'
+
parseInt
(
Math
.
random
()
*
9999999999999999
),
{
return
sequelize
.
define
(
'Project'
+
parseInt
(
Math
.
random
()
*
9999999999999999
),
{
name
:
DataTypes
.
STRING
name
:
DataTypes
.
STRING
});
});
...
...
test/integration/sequelize.test.js
View file @
a0fcd82
...
@@ -14,7 +14,6 @@ var chai = require('chai')
...
@@ -14,7 +14,6 @@ var chai = require('chai')
,
moment
=
require
(
'moment'
)
,
moment
=
require
(
'moment'
)
,
Transaction
=
require
(
__dirname
+
'/../../lib/transaction'
)
,
Transaction
=
require
(
__dirname
+
'/../../lib/transaction'
)
,
sinon
=
require
(
'sinon'
)
,
sinon
=
require
(
'sinon'
)
,
babel
=
require
(
'babel-core'
)
,
fs
=
require
(
'fs'
)
,
fs
=
require
(
'fs'
)
,
current
=
Support
.
sequelize
;
,
current
=
Support
.
sequelize
;
...
@@ -1252,14 +1251,9 @@ describe(Support.getTestDialectTeaser('Sequelize'), function() {
...
@@ -1252,14 +1251,9 @@ describe(Support.getTestDialectTeaser('Sequelize'), function() {
expect
(
Project
).
to
.
exist
;
expect
(
Project
).
to
.
exist
;
});
});
it
(
'imports a dao definition from a file compiled with babel'
,
function
()
{
it
(
'imports a dao definition with a default export'
,
function
()
{
var
es6project
=
babel
.
transformFileSync
(
__dirname
+
'/assets/es6project.es6'
,
{
presets
:
[
'es2015'
]
}).
code
;
fs
.
writeFileSync
(
__dirname
+
'/assets/es6project.js'
,
es6project
);
var
Project
=
this
.
sequelize
.
import
(
__dirname
+
'/assets/es6project'
);
var
Project
=
this
.
sequelize
.
import
(
__dirname
+
'/assets/es6project'
);
expect
(
Project
).
to
.
exist
;
expect
(
Project
).
to
.
exist
;
});
});
after
(
function
(){
after
(
function
(){
...
...
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