Просмотр исходного кода

Add .circleci/config.yml and fix errors

Simon Detheridge 6 лет назад
Родитель
Сommit
7369e2f339

+ 17 - 0
libraries/object-persistor/.circleci/config.yml

@@ -0,0 +1,17 @@
+version: 2.1
+orbs:
+  node: circleci/node@1.1.6
+jobs:
+  build-and-test:
+    executor:
+      name: node/default
+    steps:
+      - checkout
+      - node/with-cache:
+          steps:
+            - run: npm install
+            - run: npm test
+workflows:
+    build-and-test:
+      jobs:
+        - build-and-test

+ 2 - 0
libraries/object-persistor/package.json

@@ -29,10 +29,12 @@
   },
   },
   "devDependencies": {
   "devDependencies": {
     "chai": "^4.2.0",
     "chai": "^4.2.0",
+    "chai-as-promised": "^7.1.1",
     "eslint-config-prettier": "^6.11.0",
     "eslint-config-prettier": "^6.11.0",
     "eslint-config-standard": "^14.1.1",
     "eslint-config-standard": "^14.1.1",
     "eslint-plugin-chai-expect": "^2.1.0",
     "eslint-plugin-chai-expect": "^2.1.0",
     "eslint-plugin-chai-friendly": "^0.6.0",
     "eslint-plugin-chai-friendly": "^0.6.0",
+    "eslint-plugin-import": "^2.22.0",
     "eslint-plugin-mocha": "^7.0.1",
     "eslint-plugin-mocha": "^7.0.1",
     "eslint-plugin-node": "^11.1.0",
     "eslint-plugin-node": "^11.1.0",
     "eslint-plugin-prettier": "^3.1.4",
     "eslint-plugin-prettier": "^3.1.4",

+ 1 - 2
libraries/object-persistor/test/unit/FSPersistorTests.js

@@ -62,8 +62,7 @@ describe('FSPersistorTests', function () {
         crypto,
         crypto,
         'node-uuid': uuid,
         'node-uuid': uuid,
         // imported by PersistorHelper but otherwise unused here
         // imported by PersistorHelper but otherwise unused here
-        'logger-sharelatex': {},
-        'metrics-sharelatex': {}
+        'logger-sharelatex': {}
       },
       },
       globals: { console }
       globals: { console }
     }))({ paths: { uploadFolder: '/tmp' } })
     }))({ paths: { uploadFolder: '/tmp' } })

+ 1 - 7
libraries/object-persistor/test/unit/S3PersistorTests.js

@@ -28,8 +28,7 @@ describe('S3PersistorTests', function () {
   const filesSize = 33
   const filesSize = 33
   const md5 = 'ffffffff00000000ffffffff00000000'
   const md5 = 'ffffffff00000000ffffffff00000000'
 
 
-  let Metrics,
-    Logger,
+  let Logger,
     Transform,
     Transform,
     S3,
     S3,
     Fs,
     Fs,
@@ -73,10 +72,6 @@ describe('S3PersistorTests', function () {
       promise: sinon.stub().resolves()
       promise: sinon.stub().resolves()
     }
     }
 
 
-    Metrics = {
-      count: sinon.stub()
-    }
-
     ReadStream = {
     ReadStream = {
       pipe: sinon.stub().returns('readStream'),
       pipe: sinon.stub().returns('readStream'),
       on: sinon.stub(),
       on: sinon.stub(),
@@ -155,7 +150,6 @@ describe('S3PersistorTests', function () {
         './Errors': Errors,
         './Errors': Errors,
         fs: Fs,
         fs: Fs,
         stream: Stream,
         stream: Stream,
-        'metrics-sharelatex': Metrics,
         crypto
         crypto
       },
       },
       globals: { console, Buffer }
       globals: { console, Buffer }