From b43d88b7253d641fe24fcc030a58f207b2e33f10 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Mon, 28 Aug 2017 18:12:19 +0300 Subject: [PATCH] [test] Interpret render tests params: --recycleMap and --shuffle --- platform/node/test/render.test.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/platform/node/test/render.test.js b/platform/node/test/render.test.js index c8a214e91..ce549c1e2 100644 --- a/platform/node/test/render.test.js +++ b/platform/node/test/render.test.js @@ -5,9 +5,21 @@ const suiteImplementation = require('./suite_implementation'); const ignores = require('./ignores.json'); let tests; +let shuffle = false; +let recycleMap = false; -if (process.argv[1] === __filename && process.argv.length > 2) { - tests = process.argv.slice(2); +function checkParameter(param) { + const index = tests.indexOf(param); + if (index === -1) + return false; + tests.splice(index, 1); + return true; } -suite.run('native', {tests: tests, ignores: ignores}, suiteImplementation); +if (process.argv[1] === __filename && process.argv.length > 2) { + tests = process.argv.slice(2).filter((value, index, self) => { return self.indexOf(value) === index; }); + shuffle = checkParameter('--shuffle'); + recycleMap = checkParameter('--recycle-map'); +} + +suite.run('native', {tests, ignores, shuffle, recycleMap}, suiteImplementation);