|
@@ -1,21 +1,16 @@
|
|
|
-const chai = require('chai');
|
|
|
|
|
-const sinonChai = require('sinon-chai');
|
|
|
|
|
|
|
+const helpers = require('@commons/util/helpers');
|
|
|
|
|
|
|
|
-const expect = chai.expect;
|
|
|
|
|
-
|
|
|
|
|
-chai.use(sinonChai);
|
|
|
|
|
|
|
+const Crowi = require('@server/crowi');
|
|
|
|
|
|
|
|
describe('Slack Util', () => {
|
|
describe('Slack Util', () => {
|
|
|
- const helpers = require('@commons/util/helpers');
|
|
|
|
|
- const Crowi = require('@server/crowi');
|
|
|
|
|
- const crowi = new Crowi(helpers.root(), process.env);
|
|
|
|
|
|
|
+ const crowi = new Crowi(helpers.root());
|
|
|
const slack = require(`${crowi.libDir}/util/slack`)(crowi);
|
|
const slack = require(`${crowi.libDir}/util/slack`)(crowi);
|
|
|
|
|
|
|
|
test('post comment method exists', () => {
|
|
test('post comment method exists', () => {
|
|
|
- expect(slack).to.respondTo('postComment');
|
|
|
|
|
|
|
+ expect(slack.postComment).toBeInstanceOf(Function);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
test('post page method exists', () => {
|
|
test('post page method exists', () => {
|
|
|
- expect(slack).to.respondTo('postPage');
|
|
|
|
|
|
|
+ expect(slack.postPage).toBeInstanceOf(Function);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|