From 694ec61a029b17bccf17d51f4e7635e32a5e3fc3 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Sat, 27 Jun 2015 18:57:47 +0000 Subject: [PATCH] Add TC_Modules test_safe_client_debug_log --- test/unit/core/tc_modules.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/unit/core/tc_modules.rb b/test/unit/core/tc_modules.rb index e7f1f1958..956003935 100644 --- a/test/unit/core/tc_modules.rb +++ b/test/unit/core/tc_modules.rb @@ -48,4 +48,14 @@ class TC_Modules < Test::Unit::TestCase end + def test_safe_client_debug_log + Dir['../../modules/**/*.js'].each do |path| + File.open(path) do |f| + f.grep(/\W*console\.log\W*\(/im) do |line| + assert(false, "Function 'console.log' used instead of 'beef.debug' in command module: " + path + ':' + line) + end + end + end + end + end