History

Merge pull request #1321 from MasterEnoc/mocha

Update mocha to 8.2.1

Simon Legner committed 5 years ago

Commit 693adea2 parents 980ecf1 4edc8053 files · +15 −7Browse files

Unified · Split

3 files
  1. lib/docs/filters/mocha/clean_html.rb +7 −0
  2. lib/docs/filters/mocha/entries.rb +6 −5
  3. lib/docs/scrapers/mocha.rb +2 −2
lib/docs/filters/mocha/clean_html.rb+7−0
@@ -9,6 +9,13 @@ module Docs · 8 unmodified lines
9 node['data-language'] = 'javascript'9 node['data-language'] = 'javascript'
10 end10 end
11 11
12 css('#more-information ~ p').remove
13 css('#more-information').remove
14
15 css('h2 > a, h3 > a').each do |node|
16 node.remove
17 end
18
12 doc19 doc
13 end20 end
14 end21 end
lib/docs/filters/mocha/entries.rb+6−5
@@ -9,10 +9,11 @@ module Docs · 8 unmodified lines
9 'bdd' => ['describe()', 'context()', 'it()', 'specify()'],9 'bdd' => ['describe()', 'context()', 'it()', 'specify()'],
10 'tdd' => ['suite()', 'test()'],10 'tdd' => ['suite()', 'test()'],
11 'exports' => ['exports'],11 'exports' => ['exports'],
12 'qunit' => ['QUnit'],
13 'require' => ['require'],12 'require' => ['require'],
14 'browser-specific-methods' => ['mocha.allowUncaught()', 'mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'],13 'running-mocha-in-the-browser' => ['mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'],
15 'timeouts' => ['timeout()']14 'timeouts' => ['timeout()'],
15 'delayed-root-suite' => ['run()'],
16 'command-line-usage' => ['mocha cli options']
16 }17 }
17 18
18 def additional_entries19 def additional_entries
@@ -24,10 +25,10 @@ module Docs · 5 unmodified lines
24 end25 end
25 end26 end
26 27
27 css('h2').each do |node|28 css('h2, h3').each do |node|
28 name = node.content.strip29 name = node.content.strip
30 next if name.match?(/\A-/)
29 next if name.in?(%w(Examples Getting\ Started Installation More\ Information Testing\ Mocha))31 next if name.in?(%w(Examples Getting\ Started Installation More\ Information Testing\ Mocha))
30 name = 'mocha' if name == 'Usage'
31 entries << [name, node['id']]32 entries << [name, node['id']]
32 end33 end
33 34
lib/docs/scrapers/mocha.rb+2−2
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Mocha < UrlScraper2 class Mocha < UrlScraper
3 self.type = 'simple'3 self.type = 'simple'
4 self.release = '5.2.0'4 self.release = '8.2.1'
5 self.base_url = 'https://mochajs.org/'5 self.base_url = 'https://mochajs.org/'
6 self.links = {6 self.links = {
7 home: 'https://mochajs.org/',7 home: 'https://mochajs.org/',
@@ -15,7 +15,7 @@ module Docs · 7 unmodified lines
15 options[:skip_links] = true15 options[:skip_links] = true
16 16
17 options[:attribution] = <<-HTML17 options[:attribution] = <<-HTML
18 &copy; 2011&ndash;2018 JS Foundation and contributors<br>18 &copy; 2011&ndash;2020 JS Foundation and contributors<br>
19 Licensed under the Creative Commons Attribution 4.0 International License.19 Licensed under the Creative Commons Attribution 4.0 International License.
20 HTML20 HTML
21 21