From 2c8050f01ca7c781c040e6cae24bf412469ed7fd Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:29:03 +0100 Subject: [PATCH] Add Tdarr_Plugin_00td_filter_by_bitrate test --- .../Tdarr_Plugin_00td_filter_by_bitrate.js | 1 - .../Tdarr_Plugin_00td_filter_by_bitrate.js | 64 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js diff --git a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js index 5914e42..7219b51 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js +++ b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_bitrate', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js new file mode 100644 index 0000000..4c22116 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -0,0 +1,64 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 500, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 10000, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 10000, + lowerBound: 9000, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', + }, + }, +]; + +run(tests);