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
99 node['data-language'] = 'javascript'
1010 end
1111
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+
1219 doc
1320 end
1421 end
lib/docs/filters/mocha/entries.rb+6−5
@@ -9,10 +9,11 @@ module Docs · 8 unmodified lines
99 'bdd' => ['describe()', 'context()', 'it()', 'specify()'],
1010 'tdd' => ['suite()', 'test()'],
1111 'exports' => ['exports'],
12− 'qunit' => ['QUnit'],
1312 'require' => ['require'],
14− 'browser-specific-methods' => ['mocha.allowUncaught()', 'mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'],
15− 'timeouts' => ['timeout()']
13+ 'running-mocha-in-the-browser' => ['mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'],
14+ 'timeouts' => ['timeout()'],
15+ 'delayed-root-suite' => ['run()'],
16+ 'command-line-usage' => ['mocha cli options']
1617 }
1718
1819 def additional_entries
@@ -24,10 +25,10 @@ module Docs · 5 unmodified lines
2425 end
2526 end
2627
27− css('h2').each do |node|
28+ css('h2, h3').each do |node|
2829 name = node.content.strip
30+ next if name.match?(/\A-/)
2931 next if name.in?(%w(Examples Getting\ Started Installation More\ Information Testing\ Mocha))
30− name = 'mocha' if name == 'Usage'
3132 entries << [name, node['id']]
3233 end
3334
lib/docs/scrapers/mocha.rb+2−2
@@ -1,7 +1,7 @@
11 module Docs
22 class Mocha < UrlScraper
33 self.type = 'simple'
4− self.release = '5.2.0'
4+ self.release = '8.2.1'
55 self.base_url = 'https://mochajs.org/'
66 self.links = {
77 home: 'https://mochajs.org/',
@@ -15,7 +15,7 @@ module Docs · 7 unmodified lines
1515 options[:skip_links] = true
1616
1717 options[:attribution] = <<-HTML
18− &copy; 2011&ndash;2018 JS Foundation and contributors<br>
18+ &copy; 2011&ndash;2020 JS Foundation and contributors<br>
1919 Licensed under the Creative Commons Attribution 4.0 International License.
2020 HTML
2121