Procházet zdrojové kódy

normalize slack.test.js

Yuki Takei před 7 roky
rodič
revize
c4a671f70c
1 změnil soubory, kde provedl 5 přidání a 10 odebrání
  1. 5 10
      src/test/util/slack.test.js

+ 5 - 10
src/test/util/slack.test.js

@@ -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', () => {
-  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);
 
   test('post comment method exists', () => {
-    expect(slack).to.respondTo('postComment');
+    expect(slack.postComment).toBeInstanceOf(Function);
   });
 
   test('post page method exists', () => {
-    expect(slack).to.respondTo('postPage');
+    expect(slack.postPage).toBeInstanceOf(Function);
   });
 });