From 4edc80541b31a9aa33f1dd70297c31d85f644910 Mon Sep 17 00:00:00 2001 From: MasterEnoc Date: Sun, 15 Nov 2020 08:11:14 -0600 Subject: [PATCH] Update mocha to 8.2.1 --- lib/docs/filters/mocha/clean_html.rb | 7 +++++++ lib/docs/filters/mocha/entries.rb | 11 ++++++----- lib/docs/scrapers/mocha.rb | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/docs/filters/mocha/clean_html.rb b/lib/docs/filters/mocha/clean_html.rb index 8946aa30..faaeca54 100644 --- a/lib/docs/filters/mocha/clean_html.rb +++ b/lib/docs/filters/mocha/clean_html.rb @@ -9,6 +9,13 @@ module Docs node['data-language'] = 'javascript' end + css('#more-information ~ p').remove + css('#more-information').remove + + css('h2 > a, h3 > a').each do |node| + node.remove + end + doc end end diff --git a/lib/docs/filters/mocha/entries.rb b/lib/docs/filters/mocha/entries.rb index 9376a961..2930e8ef 100644 --- a/lib/docs/filters/mocha/entries.rb +++ b/lib/docs/filters/mocha/entries.rb @@ -9,10 +9,11 @@ module Docs 'bdd' => ['describe()', 'context()', 'it()', 'specify()'], 'tdd' => ['suite()', 'test()'], 'exports' => ['exports'], - 'qunit' => ['QUnit'], 'require' => ['require'], - 'browser-specific-methods' => ['mocha.allowUncaught()', 'mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'], - 'timeouts' => ['timeout()'] + 'running-mocha-in-the-browser' => ['mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'], + 'timeouts' => ['timeout()'], + 'delayed-root-suite' => ['run()'], + 'command-line-usage' => ['mocha cli options'] } def additional_entries @@ -24,10 +25,10 @@ module Docs end end - css('h2').each do |node| + css('h2, h3').each do |node| name = node.content.strip + next if name.match?(/\A-/) next if name.in?(%w(Examples Getting\ Started Installation More\ Information Testing\ Mocha)) - name = 'mocha' if name == 'Usage' entries << [name, node['id']] end diff --git a/lib/docs/scrapers/mocha.rb b/lib/docs/scrapers/mocha.rb index 04945425..968b24f4 100644 --- a/lib/docs/scrapers/mocha.rb +++ b/lib/docs/scrapers/mocha.rb @@ -1,7 +1,7 @@ module Docs class Mocha < UrlScraper self.type = 'simple' - self.release = '5.2.0' + self.release = '8.2.1' self.base_url = 'https://mochajs.org/' self.links = { home: 'https://mochajs.org/', @@ -15,7 +15,7 @@ module Docs options[:skip_links] = true options[:attribution] = <<-HTML - © 2011–2018 JS Foundation and contributors
+ © 2011–2020 JS Foundation and contributors
Licensed under the Creative Commons Attribution 4.0 International License. HTML