diff --git a/libraries/object-persistor/.circleci/config.yml b/libraries/object-persistor/.circleci/config.yml new file mode 100644 index 0000000000..4a8a9e2d14 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/libraries/object-persistor/package.json b/libraries/object-persistor/package.json index abbed2a689..9cd8a80760 100644 --- a/libraries/object-persistor/package.json +++ b/libraries/object-persistor/package.json @@ -29,10 +29,12 @@ }, "devDependencies": { "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", "eslint-config-prettier": "^6.11.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-chai-expect": "^2.1.0", "eslint-plugin-chai-friendly": "^0.6.0", + "eslint-plugin-import": "^2.22.0", "eslint-plugin-mocha": "^7.0.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.1.4", diff --git a/libraries/object-persistor/test/unit/FSPersistorTests.js b/libraries/object-persistor/test/unit/FSPersistorTests.js index 2a85e3e4e0..4c8594551d 100644 --- a/libraries/object-persistor/test/unit/FSPersistorTests.js +++ b/libraries/object-persistor/test/unit/FSPersistorTests.js @@ -62,8 +62,7 @@ describe('FSPersistorTests', function () { crypto, 'node-uuid': uuid, // imported by PersistorHelper but otherwise unused here - 'logger-sharelatex': {}, - 'metrics-sharelatex': {} + 'logger-sharelatex': {} }, globals: { console } }))({ paths: { uploadFolder: '/tmp' } }) diff --git a/libraries/object-persistor/test/unit/S3PersistorTests.js b/libraries/object-persistor/test/unit/S3PersistorTests.js index 6fe9442c2b..96c3bfac10 100644 --- a/libraries/object-persistor/test/unit/S3PersistorTests.js +++ b/libraries/object-persistor/test/unit/S3PersistorTests.js @@ -28,8 +28,7 @@ describe('S3PersistorTests', function () { const filesSize = 33 const md5 = 'ffffffff00000000ffffffff00000000' - let Metrics, - Logger, + let Logger, Transform, S3, Fs, @@ -73,10 +72,6 @@ describe('S3PersistorTests', function () { promise: sinon.stub().resolves() } - Metrics = { - count: sinon.stub() - } - ReadStream = { pipe: sinon.stub().returns('readStream'), on: sinon.stub(), @@ -155,7 +150,6 @@ describe('S3PersistorTests', function () { './Errors': Errors, fs: Fs, stream: Stream, - 'metrics-sharelatex': Metrics, crypto }, globals: { console, Buffer }