Skip to content

Commit 99e6afd

Browse files
louisgvchris-smith
authored andcommitted
House Keeping - Update Dependencies and Unit Test (#105)
* Fix unit tests from mocha update * Adding babelrc with config that supports Node 4
1 parent a151f03 commit 99e6afd

4 files changed

Lines changed: 35 additions & 23 deletions

File tree

.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"targets": {
7+
"node": 4
8+
},
9+
"exclude": [
10+
"transform-es2015-classes",
11+
"transform-es2015-block-scoping",
12+
"transform-es2015-arrow-functions"
13+
]
14+
}
15+
]
16+
]
17+
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"ros"
88
],
99
"scripts": {
10-
"test": "mocha test/directory.js",
10+
"test": "mocha --exit test/directory.js",
1111
"gennodejsTest": "mocha test/gennodejsTest.js test/onTheFlyMessages.js",
1212
"stressTest": "mocha test/stress.js",
1313
"flatten": "node tools/flatten.js",
1414
"generate": "node dist/tools/generateMessages.js",
15-
"compile": "babel --presets es2015 src/ -d dist/",
15+
"compile": "babel src/ -d dist/",
1616
"prepublish": "npm run compile"
1717
},
1818
"author": "chris smith",
@@ -22,19 +22,19 @@
2222
"url": "git://github.com/RethinkRobotics-opensource/rosnodejs"
2323
},
2424
"devDependencies": {
25-
"chai": "^3.5.0",
26-
"mocha": "^2.4.5",
2725
"babel-cli": "^6.18.0",
28-
"babel-preset-es2015": "^6.18.0"
26+
"babel-preset-env": "^1.7.0",
27+
"chai": "^4.1.2",
28+
"mocha": "^5.2.0"
2929
},
3030
"dependencies": {
31-
"argparse": "1.0.7",
32-
"async": "2.0.1",
31+
"argparse": "1.0.10",
32+
"async": "2.6.1",
3333
"bn.js": "^4.11.6",
34-
"bunyan": "1.8.1",
35-
"md5": "2.1.0",
36-
"moment": "2.19.3",
37-
"ultron": "1.1.0",
34+
"bunyan": "1.8.12",
35+
"md5": "2.2.1",
36+
"moment": "2.22.2",
37+
"ultron": "1.1.1",
3838
"walker": "1.0.7",
3939
"xmlrpc": "chfritz/node-xmlrpc"
4040
}

test/onTheFly.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const MASTER_PORT = 11234;
1111
describe('OnTheFly', function () {
1212
let master;
1313

14-
before(function (done) {
14+
before(() => {
1515
this.timeout(0);
1616

1717
master = new Master('localhost', MASTER_PORT);
@@ -22,9 +22,6 @@ describe('OnTheFly', function () {
2222
onTheFly: true,
2323
notime: true,
2424
logging: {skipRosLogging: true}})
25-
.then(() => {
26-
done();
27-
});
2825
});
2926

3027
after(() => {

test/xmlrpcTest.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ describe('Protocol Test', () => {
994994

995995
describe('Shutdown', () => {
996996
let masterStub;
997-
before((done) => {
997+
before(() => {
998998
stopMasterStub(() => {
999999
masterStub = new MasterStub('localhost', MASTER_PORT);
10001000
masterStub.provideAll();
@@ -1003,7 +1003,6 @@ describe('Protocol Test', () => {
10031003
return rosnodejs.shutdown()
10041004
.then(() => {
10051005
rosnodejs.reset();
1006-
done();
10071006
});
10081007
});
10091008

@@ -1077,16 +1076,17 @@ describe('Protocol Test', () => {
10771076

10781077
rosnodejs.initNode(nodeName, initArgs)
10791078
.then((nh) => {
1079+
10801080
const pub = nh.advertise('/chatter', 'std_msgs/String');
10811081
const sub = nh.subscribe('/chatter', 'std_msgs/String');
10821082
pub.publish({data: 'hi'});
1083+
10831084

10841085
rosnodejs.shutdown()
10851086
.then(() => {
10861087
rosnodejs.reset();
10871088
expect(gotEvent).to.be.true;
1088-
expect(nh._node._spinner._spinTimer.clientCallQueue).to.be.empty;
1089-
expect
1089+
expect(nh._node._spinner._spinTimer.clientCallQueue).to.be.undefined;
10901090
done();
10911091
});
10921092
});
@@ -1100,7 +1100,7 @@ describe('Protocol Test', () => {
11001100
describe('Parameters', function() {
11011101
let masterStub;
11021102

1103-
before((done) => {
1103+
before(() => {
11041104
masterStub = new MasterStub('localhost', MASTER_PORT);
11051105
masterStub.provideAll();
11061106

@@ -1109,15 +1109,13 @@ describe('Protocol Test', () => {
11091109
rosnodejs.reset();
11101110
return rosnodejs.initNode(nodeName, initArgs);
11111111
})
1112-
.then(() => done());
11131112
});
11141113

1115-
after((done) => {
1114+
after(() => {
11161115
masterStub.shutdown();
11171116
return rosnodejs.shutdown()
11181117
.then(() => {
11191118
rosnodejs.reset();
1120-
done();
11211119
});
11221120
});
11231121

0 commit comments

Comments
 (0)