From 04f4bf3474b8eb5c619083b4795d94a0449e1fe1 Mon Sep 17 00:00:00 2001 From: Demetrio Girardi Date: Mon, 20 Mar 2023 09:09:40 -0700 Subject: [PATCH] Disable describe.only and it.only --- test/test_index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_index.js b/test/test_index.js index 883f4d0590c..04d1412860b 100644 --- a/test/test_index.js +++ b/test/test_index.js @@ -1,3 +1,15 @@ + +[it, describe].forEach((ob) => { + ob.only = function () { + [ + 'describe.only and it.only are disabled unless you provide a single spec --file,', + 'because they can silently break the pipeline tests', + // eslint-disable-next-line no-console + ].forEach(l => console.error(l)) + throw new Error('do not use .only()') + } +}) + require('./test_deps.js'); var testsContext = require.context('.', true, /_spec$/);