From 244e992552dc9e3af5813cb9b988ab2a2b8274fe Mon Sep 17 00:00:00 2001 From: Romain Date: Wed, 10 Jul 2019 21:27:33 +0200 Subject: [PATCH] Split unit and integration tests --- jest.config.js | 15 ++++++++++++++- package.json | 2 ++ test/{video => unit}/ffargs.test.js | 0 test/{video => unit}/ffmpeg.test.js | 0 test/{image => unit}/gmagick.test.js | 0 test/{image => unit}/heic.test.js | 0 6 files changed, 16 insertions(+), 1 deletion(-) rename test/{video => unit}/ffargs.test.js (100%) rename test/{video => unit}/ffmpeg.test.js (100%) rename test/{image => unit}/gmagick.test.js (100%) rename test/{image => unit}/heic.test.js (100%) diff --git a/jest.config.js b/jest.config.js index 95495de..05fd388 100755 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,16 @@ module.exports = { - testEnvironment: 'node' + testEnvironment: 'node', + rootDir: '.', + collectCoverage: true, + collectCoverageFrom: ['lib/**/*.js'], + projects: [ + { + displayName: 'unit', + testMatch: ['/test/unit/**/*.test.js'] + }, + { + displayName: 'integration', + testMatch: ['/test/integration/**/*.test.js'] + } + ] } diff --git a/package.json b/package.json index f1a08c3..0b7aa9f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "description": "Convert / resize / transcode photos & videos to be web-friendly", "main": "lib/index.js", "scripts": { + "test:u": "jest test/unit", + "test:i": "jest test/integration", "test": "jest", "pretest": "standard && require-lint" }, diff --git a/test/video/ffargs.test.js b/test/unit/ffargs.test.js similarity index 100% rename from test/video/ffargs.test.js rename to test/unit/ffargs.test.js diff --git a/test/video/ffmpeg.test.js b/test/unit/ffmpeg.test.js similarity index 100% rename from test/video/ffmpeg.test.js rename to test/unit/ffmpeg.test.js diff --git a/test/image/gmagick.test.js b/test/unit/gmagick.test.js similarity index 100% rename from test/image/gmagick.test.js rename to test/unit/gmagick.test.js diff --git a/test/image/heic.test.js b/test/unit/heic.test.js similarity index 100% rename from test/image/heic.test.js rename to test/unit/heic.test.js