Skip to content

Commit 9f6d046

Browse files
committed
Fixed eslint warnings
1 parent 89e5975 commit 9f6d046

File tree

3 files changed

+79
-71
lines changed

3 files changed

+79
-71
lines changed

.eslintrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ const NEVER = 'never';
88
module.exports = {
99
'env': {
1010
es6: true,
11-
node: true
11+
node: true,
12+
mocha: true
1213
},
1314
plugins: [
14-
"json"
15+
"json",
16+
"mocha"
1517
],
1618
'extends': 'eslint:recommended',
1719
'rules': {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"eslint": "^3.1.1",
4141
"eslint-config-xo-space": "^0.15.0",
4242
"eslint-plugin-json": "^1.2.0",
43+
"eslint-plugin-mocha": "^4.8.0",
4344
"mocha": "^3.2.0"
4445
},
4546
"eslintConfig": {

spec/metadata.spec.js

Lines changed: 74 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3,86 +3,91 @@ const expect = require('chai').expect;
33
const insert = require('../lib/actions/insert');
44

55
describe('Metadata test', () => {
6-
const cfg = {
7-
query: 'INSERT INTO Test2.dbo.Tweets (Lang, Retweeted, Favorited, "Text", id, CreatedAt, Username, ScreenName) '
8-
+ 'VALUES (@lang:string, @retweeted:boolean, @favorited:boolean, @text:string, @id:bigint, @created_at:date, @username:string, @screenname:string)'
9-
};
6+
const cfg = {
7+
query: 'INSERT INTO Test2.dbo.Tweets (Lang, Retweeted, Favorited, "Text", id, CreatedAt, Username, ScreenName) '
8+
+ 'VALUES (@lang:string, @retweeted:boolean, @favorited:boolean, '
9+
+ '@text:string, @id:bigint, @created_at:date, @username:string, @screenname:string)'
10+
};
1011

1112

12-
it('should generate metadata', (done) => {
13-
insert.getMetaModel(cfg, (err, result) => {
14-
expect(err).to.be.null;
15-
expect(result).to.deep.equal({
16-
"in": {
17-
"properties": {
18-
"created_at": {
19-
"type": "string"
20-
},
21-
"favorited": {
22-
"type": "string"
23-
},
24-
"id": {
25-
"type": "number"
26-
},
27-
"lang": {
28-
"type": "string"
29-
},
30-
"retweeted": {
31-
"type": "string"
32-
},
33-
"screenname": {
34-
"type": "string"
35-
},
36-
"text": {
37-
"type": "string"
38-
},
39-
"username": {
40-
"type": "string"
41-
}
42-
},
43-
"type": "object"
44-
},
45-
"out": {}
46-
}
13+
it('should generate metadata', (done) => {
14+
insert.getMetaModel(cfg, (err, result) => {
15+
expect(err).to.be.null;
16+
expect(result).to.deep.equal({
17+
in: {
18+
properties: {
19+
created_at: {
20+
type: 'string'
21+
},
22+
favorited: {
23+
type: 'string'
24+
},
25+
id: {
26+
type: 'number'
27+
},
28+
lang: {
29+
type: 'string'
30+
},
31+
retweeted: {
32+
type: 'string'
33+
},
34+
screenname: {
35+
type: 'string'
36+
},
37+
text: {
38+
type: 'string'
39+
},
40+
username: {
41+
type: 'string'
42+
}
43+
},
44+
type: 'object'
45+
},
46+
out: {}
47+
}
4748
);
48-
done();
49+
done();
50+
});
4951
});
50-
});
5152

52-
it('should not fail on empty query', (done) => {
53-
insert.getMetaModel({}, (err, result) => {
54-
expect(err).to.be.null;
55-
expect(result).to.deep.equal({
56-
"in": {
57-
"properties": {},
58-
"type": "object"
59-
},
60-
"out": {}
61-
}
53+
it('should not fail on empty query', (done) => {
54+
insert.getMetaModel({}, (err, result) => {
55+
expect(err).to.be.null;
56+
expect(result).to.deep.equal({
57+
in: {
58+
properties: {},
59+
type: 'object'
60+
},
61+
out: {}
62+
}
6263
);
63-
done();
64+
done();
65+
});
6466
});
65-
});
6667

67-
it('should not handle duplicate fields', (done) => {
68-
insert.getMetaModel({
69-
query: '@foo:string @foo:string @bar:date'
70-
}, (err, result) => {
71-
expect(err).to.be.null;
72-
expect(result).to.deep.equal({
73-
"in": {
74-
"type": "object",
75-
"properties": {
76-
"foo": {type: 'string'},
77-
"bar": {type: 'string'}
68+
it('should not handle duplicate fields', (done) => {
69+
insert.getMetaModel({
70+
query: '@foo:string @foo:string @bar:date'
71+
}, (err, result) => {
72+
expect(err).to.be.null;
73+
expect(result).to.deep.equal({
74+
in: {
75+
type: 'object',
76+
properties: {
77+
foo: {
78+
type: 'string'
79+
},
80+
bar: {
81+
type: 'string'
82+
}
83+
}
84+
},
85+
out: {}
7886
}
79-
},
80-
"out": {}
81-
}
8287
);
83-
done();
88+
done();
89+
});
8490
});
85-
});
8691

8792

8893
});

0 commit comments

Comments
 (0)