Skip to content

Commit 9559610

Browse files
committed
change test code
1 parent 8206faf commit 9559610

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

info/tencentInfo.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class TencentInfo {
2424
.then(this.validate)
2525
.then(this.setDefaults),
2626

27-
'info:info': this.info.bind(this),
27+
'info:info': () => BbPromise.bind(this)
28+
.then(this.info),
2829
};
2930
}
3031

invoke/lib/invokeFunction.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ describe('InvokeFunction@Library', () => {
1515
};
1616
invokeFunction = new InvokeFunction('appid', 'secret_id', 'secret_key', options);
1717

18-
invokeFunctionStub = sinon.stub(invokeFunction, 'testInvoke')
18+
invokeFunctionStub = sinon.stub(invokeFunction, 'invoke')
1919
.returns(Promise.resolve());
2020
});
2121

2222
afterEach(() => {
23-
invokeFunction.testInvoke.restore();
23+
invokeFunction.invoke.restore();
2424
});
2525

2626
it('should make the invoke function accessible', () => {
2727
invokeFunction.should.to.be.an.instanceof(InvokeFunction);
2828
});
2929

3030
it('should run library invoke function', () => invokeFunction
31-
.testInvoke().then(()=>{
31+
.invoke().then(()=>{
3232
invokeFunctionStub.calledOnce.should.equal(true)
3333
}));
3434
});

logs/tencentLogs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class TencentLogs {
2525
.then(this.validate)
2626
.then(this.setDefaults),
2727

28-
'logs:logs': this.logs.bind(this),
28+
'logs:logs': () => BbPromise.bind(this)
29+
.then(this.logs),
2930
};
3031
}
3132

metrics/tencentMetrics.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class TencentInfo {
2424
.then(this.validate)
2525
.then(this.setDefaults),
2626

27-
'metrics:metrics': this.metrics.bind(this),
27+
'metrics:metrics': () => BbPromise.bind(this)
28+
.then(this.metrics),
2829
};
2930
}
3031

remove/tencentRemove.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class TencentRemove {
2424
.then(this.validate)
2525
.then(this.setDefaults),
2626

27-
'remove:remove': this.remove.bind(this),
27+
'remove:remove': () => BbPromise.bind(this)
28+
.then(this.remove),
2829
};
2930
}
3031

test/mocha.opts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
--recursive
22
-r test/init.js
33
invoke/**/*.test.js
4+
logs/**/*.test.js
5+
remove/**/*.test.js
6+
info/**/*.test.js
7+
metrics/**/*.test.js

0 commit comments

Comments
 (0)