Skip to content

Commit 1173fba

Browse files
committed
n/a moved static methods
1 parent c143d11 commit 1173fba

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

src/constants/staticMethods.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const staticMethods = [
2+
'and',
3+
'cast',
4+
'col',
5+
'fn',
6+
'json',
7+
'literal',
8+
'or',
9+
'useCLS',
10+
'where'
11+
]
12+
13+
module.exports = staticMethods

src/sequelize.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
const sinon = require('sinon')
22
const hooks = require('./constants/hooks')
3-
4-
const STATICS_METHODS = [
5-
'and',
6-
'cast',
7-
'col',
8-
'fn',
9-
'json',
10-
'literal',
11-
'or',
12-
'useCLS',
13-
'where'
14-
]
3+
const staticMethods = require('./constants/staticMethods')
154

165
const sequelize = {
176
define: (modelName, modelDefn, metaData = {}) => {
@@ -56,7 +45,7 @@ const sequelize = {
5645
}
5746
}
5847

59-
STATICS_METHODS.forEach(method => {
48+
staticMethods.forEach(method => {
6049
sequelize[method] = sinon.stub()
6150
})
6251

test/unit/sequelize.test.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
const { expect } = require('chai')
22

33
const sequelize = require('../../src/sequelize')
4-
5-
const STATIC_METHODS = [
6-
'and',
7-
'cast',
8-
'col',
9-
'fn',
10-
'json',
11-
'literal',
12-
'or',
13-
'useCLS',
14-
'where'
15-
]
4+
const staticMethods = require('../../src/constants/staticMethods')
165

176
describe('src/sequelize', () => {
187
it('has define', () => {
198
expect(sequelize).to.have.property('define')
209
expect(sequelize.define).to.be.a('function')
2110
})
2211

23-
STATIC_METHODS.forEach(method => {
12+
staticMethods.forEach(method => {
2413
it(`has static method ${method}`, () => {
2514
expect(sequelize[method]).to.be.a('function')
2615
})

0 commit comments

Comments
 (0)