From 1adc4bc96880001ad0292f22764675425ccb4fd9 Mon Sep 17 00:00:00 2001 From: Bernardo Guerreiro Date: Tue, 23 Jan 2024 21:32:51 +0000 Subject: [PATCH] fix: add processor --- performance/processor.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 performance/processor.js diff --git a/performance/processor.js b/performance/processor.js new file mode 100644 index 0000000..42331fd --- /dev/null +++ b/performance/processor.js @@ -0,0 +1,13 @@ +const moviesData = require('../tmdb_movies.json'); + +function myBeforeScenarioHandler(context, ee, next) { + const randomMovie = moviesData[Math.floor(Math.random() * moviesData.length)]; + + context.vars.movieId = randomMovie.id; + + next(); +}; + +module.exports = { + myBeforeScenarioHandler +} \ No newline at end of file