diff --git a/.eslintrc.json b/.eslintrc.json index 9ea43902..ed46161f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,7 +15,7 @@ }], "object-curly-newline": "off", "prefer-spread": "off", - "quotes": ["error", "double"] + "quotes": "off" }, "globals": { "runCase": "readonly" diff --git a/.gitignore b/.gitignore index c67234bd..2584e5b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.eslintcache /coverage/ /node_modules/ /yarn-error.log diff --git a/.travis.yml b/.travis.yml index 7e6d47bd..d5712e74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,18 @@ language: ruby rvm: - ruby-head -- 2.6.1 -- 2.5.3 +- 2.6.2 +- 2.5.5 branches: only: master before_install: bin/ci-install script: -- yarn test +- RUBY_VERSION=$(ruby -e 'puts RUBY_VERSION') yarn test - yarn lint - yarn build - gem build prettier.gemspec - bundle exec rake test -- bundle exec rbprettier --check 'src/ripper.rb' 'lib/**/*.rb' 'test/*_test.rb' 'prettier.gemspec' +- bundle exec rbprettier --check 'src/ripper.rb' 'lib/**/*.rb' 'test/rb/*_test.rb' 'prettier.gemspec' cache: - bundler - yarn diff --git a/CHANGELOG.md b/CHANGELOG.md index 028ee165..5ae3cd4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] ### Added - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`). +- [INTERNAL] Big tests refactor. +- Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates. ## [0.10.0] - 2019-03-25 ### Added diff --git a/Rakefile b/Rakefile index 4caa98e2..b2132881 100644 --- a/Rakefile +++ b/Rakefile @@ -4,9 +4,9 @@ require 'bundler/gem_tasks' require 'rake/testtask' Rake::TestTask.new(:test) do |t| - t.libs << 'test' + t.libs << 'test/rb' t.libs << 'lib' - t.test_files = FileList['test/**/*_test.rb'] + t.test_files = FileList['test/rb/**/*_test.rb'] end task default: :test diff --git a/package.json b/package.json index b6fa087d..c7a50689 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "src/ruby.js", "scripts": { "build": "pkg --output pkg/prettier --targets=linux,macos,win node_modules/prettier/bin-prettier.js", - "lint": "eslint .", + "lint": "eslint --cache .", "print": "prettier --plugin=.", "rubocop": "run() { prettier --plugin=. $@ | bundle exec rubocop --stdin $1; }; run", "test": "jest" @@ -32,8 +32,8 @@ "pkg": "^4.3.7" }, "jest": { - "setupFiles": [ - "./test/testRunner.js" + "setupFilesAfterEnv": [ + "./test/js/setupTests.js" ], "testRegex": ".test.js$" } diff --git a/src/nodes.js b/src/nodes.js index 143a3d80..7ca997e5 100644 --- a/src/nodes.js +++ b/src/nodes.js @@ -1,4 +1,4 @@ -const { align, breakParent, concat, dedent, group, hardline, ifBreak, indent, join, line, literalline, markAsRoot, softline, trim } = require("prettier").doc.builders; +const { align, breakParent, concat, dedent, fill, group, hardline, ifBreak, indent, join, line, literalline, markAsRoot, softline, trim } = require("prettier").doc.builders; const { removeLines } = require("prettier").doc.utils; const { concatBody, empty, first, literal, makeArgs, makeCall, makeList, prefix, printComments, skipAssignIndent } = require("./utils"); @@ -564,8 +564,15 @@ const nodes = { when: (path, opts, print) => { const [_predicates, _statements, addition] = path.getValue().body; + const predicates = path.call(print, "body", 0).reduce( + (accum, pred, index) => ( + index === 0 ? [pred] : accum.concat([",", line, pred]) + ), + null + ); + const stmts = path.call(print, "body", 1); - const parts = [group(concat(["when ", join(", ", path.call(print, "body", 0))]))]; + const parts = [group(concat(["when ", align(5, fill(predicates))]))]; if (!stmts.parts.every(part => !part)) { parts.push(indent(concat([hardline, stmts]))); diff --git a/src/nodes/blocks.js b/src/nodes/blocks.js index a25e9621..21616faa 100644 --- a/src/nodes/blocks.js +++ b/src/nodes/blocks.js @@ -110,11 +110,14 @@ const printBlock = (path, opts, print) => { return concat([breakParent, doBlock]); } + const hasBody = stmts.some(({ type }) => type !== "void_stmt"); const braceBlock = concat([ - " { ", + " {", + (hasBody || variables) ? " " : "", variables ? path.call(print, "body", 0) : "", path.call(print, "body", 1), - " }" + hasBody ? " " : "", + "}" ]); return group(ifBreak(doBlock, braceBlock)); diff --git a/src/ripper.rb b/src/ripper.rb index a62cdb27..a6dc7c4f 100755 --- a/src/ripper.rb +++ b/src/ripper.rb @@ -249,6 +249,7 @@ module InlineComments assoc_new: [:body, 1], break: [:body, 0], command: [:body, 1], + command_call: [:body, 3], string_literal: [:body, 0] } @@ -268,7 +269,7 @@ def self.prepended(base) define_method(:"on_#{event}") do |*body| @last_sexp = super(*body).tap do |sexp| - comments = sexp.dig(*path).delete(:comments) + comments = (sexp.dig(*path) || {}).delete(:comments) sexp.merge!(comments: comments) if comments end end @@ -320,7 +321,8 @@ def on_comment(body) case RipperJS.lex_state_name(state) when 'EXPR_END', 'EXPR_ARG|EXPR_LABELED', 'EXPR_ENDFN' last_sexp.merge!(comments: [sexp]) - when 'EXPR_CMDARG', 'EXPR_END|EXPR_ENDARG', 'EXPR_ENDARG', 'EXPR_ARG', 'EXPR_FNAME|EXPR_FITEM', 'EXPR_CLASS', 'EXPR_END|EXPR_LABEL' + when 'EXPR_CMDARG', 'EXPR_END|EXPR_ENDARG', 'EXPR_ENDARG', 'EXPR_ARG', + 'EXPR_FNAME|EXPR_FITEM', 'EXPR_CLASS', 'EXPR_END|EXPR_LABEL' inline_comments << sexp when 'EXPR_BEG|EXPR_LABEL', 'EXPR_MID' inline_comments << sexp.merge!(break: true) @@ -410,7 +412,7 @@ class RipperJS < Ripper builder = RipperJS.new($stdin.read) response = builder.parse - if builder.error? + if !response && builder.error? STDERR.puts 'Invalid ruby' exit 1 end diff --git a/src/ruby.js b/src/ruby.js index 6e3dacdc..9b8acc39 100644 --- a/src/ruby.js +++ b/src/ruby.js @@ -4,9 +4,11 @@ const print = require("./print"); const pragmaPattern = /#\s*@(prettier|format)/; const hasPragma = text => pragmaPattern.test(text); -// extensions, filenames and interpreters mostly pulled from linguist and rubocop -// https://github.com/github/linguist/blob/master/lib/linguist/languages.yml -// https://github.com/rubocop-hq/rubocop/blob/master/spec/rubocop/target_finder_spec.rb +/* + * metadata mostly pulled from linguist and rubocop: + * https://github.com/github/linguist/blob/master/lib/linguist/languages.yml + * https://github.com/rubocop-hq/rubocop/blob/master/spec/rubocop/target_finder_spec.rb + */ module.exports = { languages: [{ diff --git a/test/cases/__snapshots__/alias.test.js.snap b/test/cases/__snapshots__/alias.test.js.snap deleted file mode 100644 index dda1108e..00000000 --- a/test/cases/__snapshots__/alias.test.js.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`alias.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Style/GlobalVars -class AliasTest < Minitest::Test - def test_plain_alias - assert_equal 'plain alias', foo - end - - def test_global_alias - $bar = 'global alias' - assert_equal 'global alias', $foo - end - - private - - def baz - 'plain alias' - end - - alias bar baz # inline comment - alias foo bar - alias $foo $bar -end -# rubocop:enable Style/GlobalVars -" -`; diff --git a/test/cases/__snapshots__/array.test.js.snap b/test/cases/__snapshots__/array.test.js.snap deleted file mode 100644 index 3cee252e..00000000 --- a/test/cases/__snapshots__/array.test.js.snap +++ /dev/null @@ -1,189 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`array.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -class ArrayTest < Minitest::Test - def test_basics - assert_equal_join '', [] - assert_equal_join '1, 2, 3', [1, 2, 3] - assert_equal_join 'a, b, c', %w[a b c] - assert_equal_join 'a, b c, d', ['a', 'b c', 'd'] - assert_equal_join 'a, b, c', %i[a b c] - assert_equal_join 'a, b c, d', [:a, :'b c', :d] - end - - def test_literals - assert_equal_join 'a, b, c', %w[a b c] - assert_equal_join 'a, b, c', %i[a b c] - end - - # rubocop:disable Style/UnneededInterpolation - def test_string_arrays_with_interpolation - interp = 'b' - assert_equal_join 'a, b, c', ['a', \\"#{interp}\\", 'c'] - end - # rubocop:enable Style/UnneededInterpolation - - def test_literals_with_interpolation - foo = 'foo' - bar = 'bar' - baz = 'baz' - - assert_equal_join 'afooa, bbarb, cbazc', %W[a#{foo}a b#{bar}b c#{baz}c] - assert_equal_join 'afooa, bbarb, cbazc', %I[a#{foo}a b#{bar}b c#{baz}c] - end - - # rubocop:disable Lint/UnneededSplatExpansion - def test_splats - assert_equal_join '1, 2, 3, 4, 5, 6', [1, 2, *[3, 4], 5, 6] - end - # rubocop:enable Lint/UnneededSplatExpansion - - def test_long_elements - super_super_super_super_super_super_long = 'foo' - arr = [ - super_super_super_super_super_super_long, - super_super_super_super_super_super_long, - [super_super_super_super_super_super_long] - ] - - assert_equal_join('foo, foo, foo', arr) - end - - def test_reference - arr = %w[foo bar] - - assert_equal 'bar', arr[1] - end - - def test_reference_assignment - arr = %w[foo bar] - arr[1] = 'baz' - - assert_equal 'baz', arr[1] - end - - def test_comments_within_reference_assignment - arr = %w[foo bar] - arr[1] = [ - # abc - %w[abc] - ] - - assert_equal_join 'abc', arr[1] - end - - def test_dynamic_reference - arr = [1, 2, 3] - idx = 0 - - assert_equal 1, arr[idx] - end - - private - - def assert_equal_join(expected, object) - assert_equal expected, object.join(', ') - end - - def assert_equal_str(expected, object) - assert_equal expected, object.to_s - end -end -" -`; - -exports[`array.rb matches expected output 2`] = ` -"# frozen_string_literal: true - -class ArrayTest < Minitest::Test - def test_basics - assert_equal_join '', [] - assert_equal_join '1, 2, 3', [1, 2, 3] - assert_equal_join 'a, b, c', %w[a b c] - assert_equal_join 'a, b c, d', ['a', 'b c', 'd'] - assert_equal_join 'a, b, c', %i[a b c] - assert_equal_join 'a, b c, d', [:a, :'b c', :d] - end - - def test_literals - assert_equal_join 'a, b, c', %w[a b c] - assert_equal_join 'a, b, c', %i[a b c] - end - - # rubocop:disable Style/UnneededInterpolation - def test_string_arrays_with_interpolation - interp = 'b' - assert_equal_join 'a, b, c', ['a', \\"#{interp}\\", 'c'] - end - # rubocop:enable Style/UnneededInterpolation - - def test_literals_with_interpolation - foo = 'foo' - bar = 'bar' - baz = 'baz' - - assert_equal_join 'afooa, bbarb, cbazc', %W[a#{foo}a b#{bar}b c#{baz}c] - assert_equal_join 'afooa, bbarb, cbazc', %I[a#{foo}a b#{bar}b c#{baz}c] - end - - # rubocop:disable Lint/UnneededSplatExpansion - def test_splats - assert_equal_join '1, 2, 3, 4, 5, 6', [1, 2, *[3, 4], 5, 6] - end - # rubocop:enable Lint/UnneededSplatExpansion - - def test_long_elements - super_super_super_super_super_super_long = 'foo' - arr = [ - super_super_super_super_super_super_long, - super_super_super_super_super_super_long, - [super_super_super_super_super_super_long], - ] - - assert_equal_join('foo, foo, foo', arr) - end - - def test_reference - arr = %w[foo bar] - - assert_equal 'bar', arr[1] - end - - def test_reference_assignment - arr = %w[foo bar] - arr[1] = 'baz' - - assert_equal 'baz', arr[1] - end - - def test_comments_within_reference_assignment - arr = %w[foo bar] - arr[1] = [ - # abc - %w[abc], - ] - - assert_equal_join 'abc', arr[1] - end - - def test_dynamic_reference - arr = [1, 2, 3] - idx = 0 - - assert_equal 1, arr[idx] - end - - private - - def assert_equal_join(expected, object) - assert_equal expected, object.join(', ') - end - - def assert_equal_str(expected, object) - assert_equal expected, object.to_s - end -end -" -`; diff --git a/test/cases/__snapshots__/assign.test.js.snap b/test/cases/__snapshots__/assign.test.js.snap deleted file mode 100644 index f291c3ad..00000000 --- a/test/cases/__snapshots__/assign.test.js.snap +++ /dev/null @@ -1,169 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`assign.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/UselessAssignment, Style/ParallelAssignment -# rubocop:disable Metrics/MethodLength -# rubocop:disable Metrics/AbcSize -# rubocop:disable Metrics/LineLength -# rubocop:disable Metrics/ClassLength - -class AssignTest < Minitest::Test - def test_assignment - a = 1 - assert_equal 1, a - - a = - begin - 2 - end - assert_equal 2, a - end - - def test_parallel_assignment - a, b, c = [1, 2, 3] - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - a = 1, 2, 3 - assert_equal [1, 2, 3], a - - a, b, c = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - a, b, c = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - a, b, c = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - a, b, c = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - end - - def test_assign_with_splat_operator - a, *b = 1, 2, 3 - assert_equal 1, a - assert_equal [2, 3], b - - a, *b, c, d = 1, 2, 3 - assert_equal 1, a - assert_equal [], b - assert_equal 2, c - assert_equal 3, d - - a, * = 1, 2, 3 - assert_equal 1, a - - a = *a - assert_equal [1], a - - (a, b), c = [1, 2], 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - * = [1, 2, 3] - - *, a = [1, 2, 3] - assert_equal 3, a - end - - def test_or_equals_operator - a = 2 - a ||= 1 - assert_equal 2, a - end - - def test_long_variable_assignment - super_super_super_super_super_long = 'bar' - super_super_super_long, super_super_super_long, super_super_super_long = - super_super_super_super_super_long, - super_super_super_super_super_long, - super_super_super_super_super_long - assert_equal super_super_super_long, 'bar' - - a = 2 - a ||= - super_super_super_super_super_super_super_super_super_super_super_super_long - assert_equal 2, a - - super_super_super_super_super_super_super_super_super_super_super_long = - 'foo' - a = [ - super_super_super_super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_super_super_long - ] - - assert_equal %w[foo foo foo], a - end - - def test_assign_hash - super_super_super_super_super_super_super_super_super_super_long = 'foo' - - hash = { - a: super_super_super_super_super_super_super_super_super_super_long, - b: super_super_super_super_super_super_super_super_super_super_long, - c: super_super_super_super_super_super_super_super_super_super_long - } - - assert_equal({ a: 'foo', b: 'foo', c: 'foo' }, hash) - end - - def test_assign_with_sort - # rubocop:disable Lint/UnneededCopDisableDirective - # rubocop:disable Layout/MultilineMethodCallIndentation - super_super_super_super_long = 'baz' - - arr = [super_super_super_super_long, super_super_super_super_long].sort - assert_equal %w[baz baz], arr - - arr = { - a: super_super_super_super_long, b: super_super_super_super_long - }.sort - .to_h - assert_equal({ a: 'baz', b: 'baz' }, arr) - - # rubocop:enable Layout/MultilineMethodCallIndentation - # rubocop:enable Lint/UnneededCopDisableDirective - end - - def test_setter_methods - a = Struct.new(:a).new - - a.a = 1 - assert_equal 1, a.a - - super_super_super_long = - Struct.new(:super_super_super_super_super_super_super_long).new - - super_super_super_super_super_super_super_super_super_super_super_long = 1 - - super_super_super_long.super_super_super_super_super_super_super_long = - super_super_super_super_super_super_super_super_super_super_super_long - - assert_equal( - super_super_super_long.super_super_super_super_super_super_super_long, - 1 - ) - end -end - -# rubocop:enable Lint/UselessAssignment, Style/ParallelAssignment -# rubocop:enable Metrics/MethodLength -# rubocop:enable Metrics/AbcSize -# rubocop:enable Metrics/LineLength -# rubocop:enable Metrics/ClassLength -" -`; diff --git a/test/cases/__snapshots__/binary.test.js.snap b/test/cases/__snapshots__/binary.test.js.snap deleted file mode 100644 index 101396e5..00000000 --- a/test/cases/__snapshots__/binary.test.js.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`binary.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -class BinaryTest < Minitest::Test - def test_unbroken - value = true - - assert(value && value && value) - end - - def test_broken - super_super_super_super_super_long = true - - assert( - super_super_super_super_super_long && - super_super_super_super_super_long && - super_super_super_super_super_long - ) - end -end -" -`; diff --git a/test/cases/__snapshots__/blocks.test.js.snap b/test/cases/__snapshots__/blocks.test.js.snap deleted file mode 100644 index 118f8dc1..00000000 --- a/test/cases/__snapshots__/blocks.test.js.snap +++ /dev/null @@ -1,120 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`blocks.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/UnusedBlockArgument - -loop { 1 } - -loop { 1 } - -loop do - # foobar -end - -port ENV.fetch('PORT') { 3000 } - -test 'foobar' do -end - -te.st 'foobar' do -end - -test 'foobar' do - foobar -end - -te.st 'foobar' do - foobar -end - -test 'foobar', &:to_s - -te.st 'foobar', &:to_s - -loop do - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -loop { super_super_super_super_super_super_super_super_super_super_super_long } - -loop { |i| 1 } - -loop { |i; j| 1 } - -loop { |i| i } - -loop { |*| i } - -loop { |(a, b)| i } - -loop { |a, (b, c), d, *e| i } - -loop do |i| - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -loop { |i| super_super_super_super_super_super_super_super_super_super_long } - -# rubocop:disable Metrics/LineLength -define_method :long_method_name_that_forces_overflow do |_some_long_argument_that_overflows = Time.now, _other_arg = nil| -end -# rubocop:enable Metrics/LineLength - -some_method.each do |foo| - bar - baz -end.to_i - -[ - super_super_super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_super_long -].to_s - -{ - a: 'super_super_super_super_super_super_super_super_super_super_long', - b: 'super_super_super_super_super_super_super_super_super_super_long' -}.to_s - -loop(&:to_s) - -loop(&:to_s) - -loop do |i| - i.to_s - i.next -end - -loop { |i| i.to_s :db } - -loop { |i, j| i.to_s } - -[1, 2, 3].each do |i| - p i -end - -def change - change_table :foo do - column :bar - end -end - -foo 'foo', &:to_s - -target.method object.map do |arg| - arg * 2 -end - -# from ruby test/ruby/test_call.rb -assert_nil( - ( - 'a'.sub! 'b' do - end&.foo do - end - ) -) - -# rubocop:enable Lint/UnusedBlockArgument -" -`; diff --git a/test/cases/__snapshots__/break.test.js.snap b/test/cases/__snapshots__/break.test.js.snap deleted file mode 100644 index 89dc4e0f..00000000 --- a/test/cases/__snapshots__/break.test.js.snap +++ /dev/null @@ -1,14 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`break.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -[].each { break } - -[].each { break 1 } - -[].each { break 1 } - -[].each { break 1, 2 } -" -`; diff --git a/test/cases/__snapshots__/case.test.js.snap b/test/cases/__snapshots__/case.test.js.snap deleted file mode 100644 index 747356a5..00000000 --- a/test/cases/__snapshots__/case.test.js.snap +++ /dev/null @@ -1,45 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`case.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/EmptyWhen, Style/EmptyCaseCondition - -case -when a - 1 -end - -case a -when b - 1 -end - -case a -when b, c - 1 -end - -case a -when b -when c - 1 -end - -case a -when b - 1 -when c - 2 -end - -case a -when b - 1 -else - 2 -end - -# rubocop:enable Lint/EmptyWhen, Style/EmptyCaseCondition -" -`; diff --git a/test/cases/__snapshots__/class.test.js.snap b/test/cases/__snapshots__/class.test.js.snap deleted file mode 100644 index 4d5d3cce..00000000 --- a/test/cases/__snapshots__/class.test.js.snap +++ /dev/null @@ -1,74 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`class.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -module Pret - module Tier - # object documentation - class Object; end - - # second object - # documentation - class Object; end - - # third object - # documentation - class Object - attr_accessor :foo - end - - class Object < BasicObject; end - - class Object < BasicObject; end - - class Object < BasicObject - # inside class documentation - attr_accessor :bar - end - - class SuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLongClassName - end - - module SuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLongModName - end - - class << self - # method documentation - def method1; end - - def method2; end - - def method3; end - - def method_with_a_long_name1; end - - def method_with_a_long_name2; end - - def method_with_a_long_name3; end - - undef method1 - undef method2, method3 - undef method_with_a_long_name1, - method_with_a_long_name2, - method_with_a_long_name3 - end - - module Prettier; end - - module Prettier; end - - module Prettier - # inside module documentation - attr_accessor :foo - end - end -end - -Pret::Tier::Object # rubocop:disable Lint/Void -Pret::TIER = 'config'.to_s - -::Pret::Tier::Object # rubocop:disable Lint/Void -::PRET = 'config'.to_s -" -`; diff --git a/test/cases/__snapshots__/comments.test.js.snap b/test/cases/__snapshots__/comments.test.js.snap deleted file mode 100644 index 3484fed3..00000000 --- a/test/cases/__snapshots__/comments.test.js.snap +++ /dev/null @@ -1,147 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`comments.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# this is a comment at -# the beginning of the file -# rubocop:disable Lint/Void - -loop do - # this is the only statement - # inside this loop -end - -loop do - # this is the first statement - # inside this loop - foo -end - -loop do - foo - # this is the last statement - # inside this loop -end - -def foo - # these are the only statements - # inside this method -end - -class Foo - # these are the only statements - # inside this class -end - -module Foo - # these are the only statements - # inside this module -end - -module Foo - class Foo - def foo - # this comment is inside a method - end - - def bar - print message # this is an inline comment - end - - def self.foo - # this comment is inside a self method - end - end -end - -foo # this is an inline comment -bar # this is another inline comment - -foo 'bar' # this is an inline comment - -[ - # these are comments - # inside of an array - foo, - # inside of an array - bar -] - -{ - # these are comments - foo: 'bar', - # inside of a hash - bar: 'baz' -} - -foo # inline comment inside of a dot - .bar - -Foo.where(foo: bar, bar: baz).to_a.find do |foo| - # This is a comment - foo.foo == bar.foo -end - -if foo - # this is a comment in an if - bar -end - -unless foo - # this is a comment in an unless - bar -end - -while foo - # this is a comment at the beginning of a while - bar -end - -while foo - bar - # this is a comment at the end of a while -end - -until foo - # this is a comment at the beginning of a until - bar -end - -until foo - bar - # this is a comment at the end of a until -end - -case foo -when bar - # this is a comment at the beginning of a when - 1 -when baz - 2 - # this is a comment at the end of a when -end - -begin - # comment at the beginning of a begin - 1 -rescue StandardError - # comment at the beginning of a rescue - 2 -ensure - # comment at the end of a rescue - 3 -end - -# rubocop:enable Lint/Void -# this is a comment -# at the end of the file - -__END__ - /‾‾‾‾‾\\\\ /‾‾‾‾‾\\\\ /‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾/ /‾‾‾‾‾\\\\ - / /‾‾/ / / /‾‾/ / / /‾‾‾ ‾‾/ /‾‾ ‾‾/ /‾‾ ‾‾/ /‾‾ / /‾‾‾ / /‾‾/ / - / ‾‾‾ / / ‾‾‾_/ / _‾/ / / / / / / / _‾/ / ‾‾‾_/ - / /‾‾‾‾‾ / /‾\\\\ \\\\ / /__ / / / / __/ /_ / /__ / /‾\\\\ \\\\ -/_/ /_/ /_/ /____/ /_/ /_/ /_____/ /____/ /_/ /_/ -" -`; diff --git a/test/cases/__snapshots__/conditionals.test.js.snap b/test/cases/__snapshots__/conditionals.test.js.snap deleted file mode 100644 index 6e9c60fd..00000000 --- a/test/cases/__snapshots__/conditionals.test.js.snap +++ /dev/null @@ -1,239 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`conditionals.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -if a - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Style/Not, Style/NegatedIf, Lint/EmptyExpression -b if not a - -# from ruby test/ruby/test_not.rb -assert_equal(true, (not ())) -# rubocop:enable Style/Not, Style/NegatedIf, Lint/EmptyExpression - -if a - break # comment -end - -if a - -else - b -end - -if a - 1 -elsif b - 2 -end - -if a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -if a - 1 -elsif b - 2 -elsif c - 3 -else - 4 -end - -unless a - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Style/UnlessElse -unless a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end -# rubocop:enable Style/UnlessElse - -1 if a - -if super_super_super_super_super_super_super_super_super_super_super_super_long - 1 -end - -1 unless a - -unless super_super_super_super_super_super_super_super_super_super_super_suplong - 1 -end - -a ? 1 : 2 - -a ? 2 : 1 - -a ? 1 : 2 -if a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -if a - b 1 -else - b(2) -end - -if a - b(1) -else - b 2 -end - -a b do - if a - a 'foo' - else - b - end -end - -if Some::Constant - .super_super_super_super_super_super_super_super_super_super_long - 1 -elsif Some::Constant - .super_super_super_super_super_super_super_super_super_super_long - 2 -end - -unless Some::Constant - .super_super_super_super_super_super_super_super_super_super_long - 1 -end -" -`; - -exports[`conditionals.rb matches expected output 2`] = ` -"# frozen_string_literal: true - -if a - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Style/Not, Style/NegatedIf, Lint/EmptyExpression -if not a - b -end - -# from ruby test/ruby/test_not.rb -assert_equal(true, (not ())) -# rubocop:enable Style/Not, Style/NegatedIf, Lint/EmptyExpression - -if a - break # comment -end - -if a - -else - b -end - -if a - 1 -elsif b - 2 -end - -if a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -if a - 1 -elsif b - 2 -elsif c - 3 -else - 4 -end - -unless a - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Style/UnlessElse -unless a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end -# rubocop:enable Style/UnlessElse - -if a - 1 -end - -if super_super_super_super_super_super_super_super_super_super_super_super_long - 1 -end - -unless a - 1 -end - -unless super_super_super_super_super_super_super_super_super_super_super_suplong - 1 -end - -a ? 1 : 2 - -a ? 2 : 1 - -a ? 1 : 2 -if a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -if a - b 1 -else - b(2) -end - -if a - b(1) -else - b 2 -end - -a b do - if a - a 'foo' - else - b - end -end - -if Some::Constant - .super_super_super_super_super_super_super_super_super_super_long - 1 -elsif Some::Constant - .super_super_super_super_super_super_super_super_super_super_long - 2 -end - -unless Some::Constant - .super_super_super_super_super_super_super_super_super_super_long - 1 -end -" -`; diff --git a/test/cases/__snapshots__/defined.test.js.snap b/test/cases/__snapshots__/defined.test.js.snap deleted file mode 100644 index 6499bf66..00000000 --- a/test/cases/__snapshots__/defined.test.js.snap +++ /dev/null @@ -1,28 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`defined.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/Void - -defined?(a) # first - -defined?(a) # second - -defined?( - super_super_super_super_super_super_super_super_super_super_super_super_long -) - -defined?( - super_super_super_super_super_super_super_super_super_super_super_super_long -) - -defined?( - super_super_super_super_super_super_super_super_super_super_super_super_long -) - -defined?(a) # third - -# rubocop:enable Lint/Void -" -`; diff --git a/test/cases/__snapshots__/embdoc.test.js.snap b/test/cases/__snapshots__/embdoc.test.js.snap deleted file mode 100644 index 8c37b48e..00000000 --- a/test/cases/__snapshots__/embdoc.test.js.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`embdoc.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Style/BlockComments - -=begin -this is - -some really - -long documentation -that is contained -in an embdoc -=end - -class Foo -=begin -this is an embdoc inside a class -=end -end - -module Foo - class Foo -=begin -this is an embdoc even more indented -=end - end -end - -# rubocop:enable Style/BlockComments -" -`; diff --git a/test/cases/__snapshots__/encoding.test.js.snap b/test/cases/__snapshots__/encoding.test.js.snap deleted file mode 100644 index 2bd13bdb..00000000 --- a/test/cases/__snapshots__/encoding.test.js.snap +++ /dev/null @@ -1,16 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`encoding.rb matches expected output 1`] = ` -"# -*- encoding: binary -*- -# frozen_string_literal: true - -# rubocop:disable Lint/Void, Style/AsciiComments - -# il était -:il_était -'ひらがな' -/ひらがな/ - -# rubocop:enable Lint/Void, Style/AsciiComments -" -`; diff --git a/test/cases/__snapshots__/hash.test.js.snap b/test/cases/__snapshots__/hash.test.js.snap deleted file mode 100644 index ddd79702..00000000 --- a/test/cases/__snapshots__/hash.test.js.snap +++ /dev/null @@ -1,87 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`hash.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/Void - -{} - -{ a: 'a', b: 'b', c: 'c' } - -{ a: 'a', b: 'b', c: 'c' } - -{ Foo => 1, Bar => 2 } - -{ - super_super_super_super_super_super_super_super_long: - super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_long: { - super_super_super_super_super_super_super_super_long: - super_super_super_super_super_super_super_super_long - } -} - -foo abc: true # some comment - -foobar alpha: alpha, - beta: beta, - gamma: gamma, - delta: delta, - epsilon: epsilon, - zeta: zeta -foobar( - alpha: alpha, - beta: beta, - gamma: gamma, - delta: delta, - epsilon: epsilon, - zeta: zeta -) - -# rubocop:enable Lint/Void -" -`; - -exports[`hash.rb matches expected output 2`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/Void - -{} - -{ :a => 'a', :b => 'b', :c => 'c' } - -{ :a => 'a', :b => 'b', :c => 'c' } - -{ Foo => 1, Bar => 2 } - -{ - :super_super_super_super_super_super_super_super_long => - super_super_super_super_super_super_super_super_long, - :super_super_super_super_super_super_super_super_super_long => { - :super_super_super_super_super_super_super_super_long => - super_super_super_super_super_super_super_super_long - } -} - -foo :abc => true # some comment - -foobar :alpha => alpha, - :beta => beta, - :gamma => gamma, - :delta => delta, - :epsilon => epsilon, - :zeta => zeta -foobar( - :alpha => alpha, - :beta => beta, - :gamma => gamma, - :delta => delta, - :epsilon => epsilon, - :zeta => zeta -) - -# rubocop:enable Lint/Void -" -`; diff --git a/test/cases/__snapshots__/hooks.test.js.snap b/test/cases/__snapshots__/hooks.test.js.snap deleted file mode 100644 index 2847409c..00000000 --- a/test/cases/__snapshots__/hooks.test.js.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`hooks.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Style/BeginBlock, Style/EndBlock - -BEGIN { p 'begin' } - -BEGIN { p 'begin' } - -BEGIN { - super_super_super_super_super_super_super_super_super_super_super_super_long -} - -BEGIN { - super_super_super_super_super_super_super_super_super_super_super_super_long -} - -END { p 'end' } - -END { p 'end' } - -END { - super_super_super_super_super_super_super_super_super_super_super_super_long -} - -END { - super_super_super_super_super_super_super_super_super_super_super_super_long -} - -# rubocop:enable Style/BeginBlock, Style/EndBlock -" -`; diff --git a/test/cases/__snapshots__/interpreter.test.js.snap b/test/cases/__snapshots__/interpreter.test.js.snap deleted file mode 100644 index 04b48c72..00000000 --- a/test/cases/__snapshots__/interpreter.test.js.snap +++ /dev/null @@ -1,9 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`interpreter matches expected output 1`] = ` -"#!/usr/bin/env ruby -# frozen_string_literal: true - -does(something) -" -`; diff --git a/test/cases/__snapshots__/kwargs.test.js.snap b/test/cases/__snapshots__/kwargs.test.js.snap deleted file mode 100644 index ee0d444b..00000000 --- a/test/cases/__snapshots__/kwargs.test.js.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`kwargs.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -class KwargsTest < Minitest::Test - def test_kwargs - assert_equal 10, add(alpha: 1, beta: 2, gamma: 3, delta: 4) - - args = { alpha: 1, beta: 2, gamma: 3 } - assert_equal 10, add(**args, delta: 4) - end - - private - - def add(alpha:, beta:, gamma: 1, delta: 2) - alpha + beta + gamma + delta - end -end -" -`; diff --git a/test/cases/__snapshots__/lambda.test.js.snap b/test/cases/__snapshots__/lambda.test.js.snap deleted file mode 100644 index 5104e7de..00000000 --- a/test/cases/__snapshots__/lambda.test.js.snap +++ /dev/null @@ -1,49 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`lambda.rb matches expected output 1`] = ` -"# frozen_string_literal: true - --> { 1 } - -->(a, b, c) { a + b + c } - -lambda do - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -lambda do |a, b, c| - a + b + c + super_super_super_super_super_super_super_super_super_long -end - -a.call(1, 2, 3) - -a.call(1, 2, 3) - -a[] - -a[1, 2, 3] - -->(a) { a } - --> { 1 } - -command :foobar, ->(argument) { argument + argument } -comm.and :foobar, ->(argument) { argument + argument } - -command :fooooooooooooobaaaaaaarrrrr, - lambda { |argument| - argument + argument + argument + argument + argument + argument - } -comm.and :fooooooooooooobaaaaaaarrrrr, - lambda { |argument| - argument + argument + argument + argument + argument + argument - } - -# rubocop:disable Metrics/LineLength -command :fooooooooooooobaaaaaaarrrrr, - lambda { |_fooooooooooooobaaaaaaarrrrr1, _fooooooooooooobaaaaaaarrrrr2, _fooooooooooooobaaaaaaarrrrr3| - true - } -# rubocop:enable Metrics/LineLength -" -`; diff --git a/test/cases/__snapshots__/layout.test.js.snap b/test/cases/__snapshots__/layout.test.js.snap deleted file mode 100644 index 61dff680..00000000 --- a/test/cases/__snapshots__/layout.test.js.snap +++ /dev/null @@ -1,28 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`layout.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/Void - -1 - -def foobar - 2 - - 3 - 4 - 5 - - 6 -end - -7 -8 -9 - -10 - -# rubocop:enable Lint/Void -" -`; diff --git a/test/cases/__snapshots__/method.test.js.snap b/test/cases/__snapshots__/method.test.js.snap deleted file mode 100644 index a9032016..00000000 --- a/test/cases/__snapshots__/method.test.js.snap +++ /dev/null @@ -1,299 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`method.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/DuplicateMethods, Lint/UnusedMethodArgument -# rubocop:disable Metrics/ParameterLists - -def foo; end - -def foo(); end - -def foo(alpha); end - -def foo(alpha); end - -def self.foo; end - -def self.foo(); end - -def self.foo(alpha); end - -def self.foo(alpha); end - -def foo(alpha, beta, *gamma, delta, epsilon:, zeta:, eta: 1, **theta, &block) - 'what' -end - -def foo( - alpha:, - beta:, - gamma:, - delta:, - epsilon:, - zeta:, - eta:, - theta:, - iota:, - kappa:, - lambda: -) - 'what' -end - -def foo(alpha) - 1 -end - -def foo(*); end - -def foo(**); end - -foo - -foo(1) -foo(1, 2) -foo(1, 2, *abc) -foo(1, 2, *abc, 3, 4) -foo( - aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii -) -foo( - aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii -) -foo( - aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - &block -) - -foo aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii -foo.foo aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii - -Foo::Bar::Baz.qux aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii -Foo::Bar::Baz.qux aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii, - &block - -foo(*bar) -foo(**baz) -foo(&block) - -foo(*bar, &block) -foo(**baz, &block) -foo(*bar, **baz, &block) - -foo(h: 1, **bar) -foo(**bar, h: 1) -foo(h: 1, **bar, i: 2) - -Foo.foo -foo&.foo - -# rubocop:enable Lint/DuplicateMethods, Lint/UnusedMethodArgument -# rubocop:enable Metrics/ParameterLists -" -`; - -exports[`method.rb matches expected output 2`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/DuplicateMethods, Lint/UnusedMethodArgument -# rubocop:disable Metrics/ParameterLists - -def foo; end - -def foo(); end - -def foo(alpha); end - -def foo(alpha); end - -def self.foo; end - -def self.foo(); end - -def self.foo(alpha); end - -def self.foo(alpha); end - -def foo(alpha, beta, *gamma, delta, epsilon:, zeta:, eta: 1, **theta, &block) - 'what' -end - -def foo( - alpha:, - beta:, - gamma:, - delta:, - epsilon:, - zeta:, - eta:, - theta:, - iota:, - kappa:, - lambda: -) - 'what' -end - -def foo(alpha) - 1 -end - -def foo(*); end - -def foo(**); end - -foo - -foo(1) -foo(1, 2) -foo(1, 2, *abc) -foo(1, 2, *abc, 3, 4) -foo( - aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii, -) -foo( - aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii, -) -foo( - aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - &block -) - -foo aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii -foo.foo aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii - -Foo::Bar::Baz.qux aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii -Foo::Bar::Baz.qux aaaaaaa, - bbbbbbb, - ccccccc, - ddddddd, - eeeeeee, - fffffff, - ggggggg, - hhhhhhh, - iiiiiii, - &block - -foo(*bar) -foo(**baz) -foo(&block) - -foo(*bar, &block) -foo(**baz, &block) -foo(*bar, **baz, &block) - -foo(h: 1, **bar) -foo(**bar, h: 1) -foo(h: 1, **bar, i: 2) - -Foo.foo -foo&.foo - -# rubocop:enable Lint/DuplicateMethods, Lint/UnusedMethodArgument -# rubocop:enable Metrics/ParameterLists -" -`; diff --git a/test/cases/__snapshots__/next.test.js.snap b/test/cases/__snapshots__/next.test.js.snap deleted file mode 100644 index 23618036..00000000 --- a/test/cases/__snapshots__/next.test.js.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`next.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -class NextTest < Minitest::Test - def test_no_args - result = [1, 2, 3].map { next } - - assert_equal [nil, nil, nil], result - end - - def test_one_arg_no_parens - result = [1, 2, 3].map { next 1 } - - assert_equal [1, 1, 1], result - end - - def test_one_arg_with_parens - result = [1, 2, 3].map { next 1 } - - assert_equal [1, 1, 1], result - end - - def test_multi_args_no_parens - result = [1, 2, 3].map { next 1, 2 } - - assert_equal [[1, 2], [1, 2], [1, 2]], result - end -end -" -`; diff --git a/test/cases/__snapshots__/numbers.test.js.snap b/test/cases/__snapshots__/numbers.test.js.snap deleted file mode 100644 index 12f4547b..00000000 --- a/test/cases/__snapshots__/numbers.test.js.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`numbers.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -class NumbersTest < Minitest::Test - def test_numbers - assert_equal_str '123', 123 - assert_equal_str '-123', -123 - assert_equal_str '1123', 1_123 - assert_equal_str '-543', -543 - assert_equal_str '123456789123456789', 123_456_789_123_456_789 - end - - def test_floats - assert_equal_str '123.45', 123.45 - assert_equal_str '0.0012', 1.2e-3 - end - - def test_bases - assert_equal_str '43707', 0xaabb - assert_equal_str '255', 0o377 - assert_equal_str '-10', -0b1010 - assert_equal_str '9', 0b001_001 - end - - private - - def assert_equal_str(expected, value) - assert_equal expected, value.to_s - end -end -" -`; diff --git a/test/cases/__snapshots__/ranges.test.js.snap b/test/cases/__snapshots__/ranges.test.js.snap deleted file mode 100644 index ea1b2e48..00000000 --- a/test/cases/__snapshots__/ranges.test.js.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ranges.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/UselessAssignment - -dot2 = 1..2 # dot2 -dot3 = 3...4 # dot3 - -# rubocop:enable Lint/UselessAssignment -" -`; diff --git a/test/cases/__snapshots__/regexp.test.js.snap b/test/cases/__snapshots__/regexp.test.js.snap deleted file mode 100644 index e2c8fe45..00000000 --- a/test/cases/__snapshots__/regexp.test.js.snap +++ /dev/null @@ -1,81 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`regexp.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -class RegexpTest < Minitest::Test - def test_default - regexp = /abc/ - - assert_match regexp, 'abcde' - end - - def test_braces - regexp = /abc/ - - assert_match regexp, 'abcde' - end - - def test_braces_with_slashes - regexp = %r{a/b/c} - - assert_match regexp, 'a/b/c/d/e' - end - - def test_slashes - regexp = /abc/ - - assert_match regexp, 'abcde' - end - - def test_brackets - regexp = /abc/ - - assert_match regexp, 'abcde' - end - - def test_parens - regexp = /abc/ - - assert_match regexp, 'abcde' - end - - def test_interpolation - inter = 'b' - regexp = /a#{inter}c/ - - assert_match regexp, 'abcde' - end - - def test_modifier - regexp = /abc/i - - assert_match regexp, 'ABCDE' - end - - def test_brace_modifier - regexp = /abc/i - - assert_match regexp, 'ABCDE' - end - - def test_global_interpolation - 'foo' =~ /foo/ - regexp = /#{$&}/ - - assert_match regexp, 'foobar' - end - - def test_float - float_pat = /\\\\A - [[:digit:]]+ # 1 or more digits before the decimal point - (\\\\. # Decimal point - [[:digit:]]+ # 1 or more digits after the decimal point - )? # The decimal point and following digits are optional - \\\\Z/x - - assert_match float_pat, '12.56' - end -end -" -`; diff --git a/test/cases/__snapshots__/rescue.test.js.snap b/test/cases/__snapshots__/rescue.test.js.snap deleted file mode 100644 index 95ec6d9b..00000000 --- a/test/cases/__snapshots__/rescue.test.js.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`rescue.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -begin - 1 -rescue ArgumentError - retry -rescue NoMethodError => exception - puts exception - redo -rescue SyntaxError, NoMethodError - 2 -rescue SomeSuperSuperLongError, - SomeOtherSuperSuperLongError, - OneLastSuperLongError - 3 -rescue StandardError - 4 -else - 5 -ensure - 6 -end - -begin - a -rescue StandardError - nil -end - -# from ruby spec/ruby/language/rescue_spec.rb -def foo - a -rescue A, *B => e - e -end -" -`; diff --git a/test/cases/__snapshots__/return.test.js.snap b/test/cases/__snapshots__/return.test.js.snap deleted file mode 100644 index 87e4774d..00000000 --- a/test/cases/__snapshots__/return.test.js.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`return.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/UnneededCopDisableDirective -# rubocop:disable Style/GuardClause, Style/RedundantReturn - -def foo - return if a -end - -def bar - return 1 if a -end - -def baz - return 1 if a -end - -def qux - return 1, 2 if a -end - -def qax - return foo :bar if a -end - -# rubocop:enable Style/GuardClause, Style/RedundantReturn -# rubocop:enable Lint/UnneededCopDisableDirective -" -`; diff --git a/test/cases/__snapshots__/strings.test.js.snap b/test/cases/__snapshots__/strings.test.js.snap deleted file mode 100644 index 7eb6ee29..00000000 --- a/test/cases/__snapshots__/strings.test.js.snap +++ /dev/null @@ -1,343 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`strings.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/UnneededCopDisableDirective - -# rubocop:disable Layout/ClosingParenthesisIndentation -# rubocop:disable Layout/SpaceInsideStringInterpolation -# rubocop:disable Lint/InterpolationCheck -# rubocop:disable Lint/LiteralInInterpolation, Layout/ClosingHeredocIndentation -# rubocop:disable Lint/Void, Layout/IndentHeredoc, Lint/UselessAssignment -# rubocop:disable Style/StringLiteralsInInterpolation -# rubocop:disable Style/UnneededInterpolation - -'a' # these are CHARs -?\\\\C-a -?\\\\M-a -?\\\\M-\\\\C-a - -'' - -'abc' - -\\"abc's\\" - -'abc' - -\\"abc\\\\n\\" - -'\\\\n' -\\"\\\\n\\" -'\\\\x0' -\\"\\\\x0\\" -'#{\\"\\\\n\\"}' -\\"#{\\"\\\\n\\"}\\" -\\"#{'\\\\n'}\\" -\\"#{'\\\\n'}#{\\"\\\\n\\"}\\" -\\"#{\\"\\\\n#{'\\\\n'}#{\\"\\\\n\\"}\\\\n\\"}#{'\\\\n'}\\" - -\\"\\\\M-\\\\C-a\\" - -\\"abc #{super} abc\\" - -\\"#{abc} abc\\" - -\\"{\\\\\\"abc\\\\\\": \\\\\\"foo\\\\nbar\\\\\\"}\\" - -# rubocop:disable Style/Semicolon -\\"abc #{foo; bar} abc\\" -# rubocop:enable Style/Semicolon - -\\"abc #{de} fghi #{jkl} mno\\" - -'abc' \\\\ - 'def' \\\\ - 'ghi' - -\\"abc #{\\"abc #{abc} abc\\"} abc\\" - -{ 'a' => 1 } - -{ \\"a #{a}\\" => 1 } - -:\\"abc#{abc}abc\\" -:'abc#{abc}abc' - -\`abc\` -\`super_super_super_super_super_super_super_super_super_super_super_super_s_long\` -\` - super_super_super_super_super_super_super_super_super_super_super_super_s_long -\`.to_s - -<<-HERE -This is a straight heredoc! -HERE - -<<-HERE -This is another straight heredoc, this time with interpolation! -#{interpolation} -So interpolated right now. -HERE - -abc = <<-HERE -This is a straight heredoc on an assign! -HERE - -<<-PARENT -This is a straight heredoc! -#{<<-CHILD -Why do I do this -CHILD -} -PARENT - -<<~HERE - This is a squiggly heredoc! -HERE - -<<~HERE - This is another squiggly heredoc, this time with interpolation! - #{interpolation} - So interpolated right now. -HERE - -abc = <<~HERE - This is a squiggly heredoc on an assign! -HERE - -<<~PARENT - This is a squiggly heredoc! - #{<<~CHILD - Why do I do this - CHILD -} -PARENT - -<<-GRAND -#{'interpolated'} -<<~PARENT - #{'more interpolated'} - <<-CHILD - #{'what is going on'} - CHILD - #{'more interpolated'} -PARENT -#{'interpolated'} -GRAND - -'abc \\"abc\\" abc' - -foo_bar 1, 2, 3, <<-HERE - baz -HERE - -foo.bar 1, 2, 3, <<-HERE - baz -HERE - -foo_bar(1, 2, 3, <<-HERE) - baz -HERE - -foo_bar 1, 2, 3, <<-HERE, <<-THERE - here -HERE - there -THERE - -foo.bar 1, 2, 3, <<-HERE, <<-THERE - here -HERE - there -THERE - -foo_bar(1, 2, 3, <<-HERE, <<-THERE) - here -HERE - there -THERE - -# rubocop:enable Layout/ClosingParenthesisIndentation -# rubocop:enable Layout/SpaceInsideStringInterpolation -# rubocop:enable Lint/InterpolationCheck -# rubocop:enable Lint/LiteralInInterpolation, Layout/ClosingHeredocIndentation -# rubocop:enable Lint/Void, Layout/IndentHeredoc, Lint/UselessAssignment -# rubocop:enable Style/StringLiteralsInInterpolation -# rubocop:enable Style/UnneededInterpolation - -# rubocop:enable Lint/UnneededCopDisableDirective -" -`; - -exports[`strings.rb matches expected output 2`] = ` -"# frozen_string_literal: true - -# rubocop:disable Lint/UnneededCopDisableDirective - -# rubocop:disable Layout/ClosingParenthesisIndentation -# rubocop:disable Layout/SpaceInsideStringInterpolation -# rubocop:disable Lint/InterpolationCheck -# rubocop:disable Lint/LiteralInInterpolation, Layout/ClosingHeredocIndentation -# rubocop:disable Lint/Void, Layout/IndentHeredoc, Lint/UselessAssignment -# rubocop:disable Style/StringLiteralsInInterpolation -# rubocop:disable Style/UnneededInterpolation - -\\"a\\" # these are CHARs -?\\\\C-a -?\\\\M-a -?\\\\M-\\\\C-a - -\\"\\" - -\\"abc\\" - -\\"abc's\\" - -\\"abc\\" - -\\"abc\\\\n\\" - -'\\\\n' -\\"\\\\n\\" -'\\\\x0' -\\"\\\\x0\\" -'#{\\"\\\\n\\"}' -\\"#{\\"\\\\n\\"}\\" -\\"#{'\\\\n'}\\" -\\"#{'\\\\n'}#{\\"\\\\n\\"}\\" -\\"#{\\"\\\\n#{'\\\\n'}#{\\"\\\\n\\"}\\\\n\\"}#{'\\\\n'}\\" - -\\"\\\\M-\\\\C-a\\" - -\\"abc #{super} abc\\" - -\\"#{abc} abc\\" - -\\"{\\\\\\"abc\\\\\\": \\\\\\"foo\\\\nbar\\\\\\"}\\" - -# rubocop:disable Style/Semicolon -\\"abc #{foo; bar} abc\\" -# rubocop:enable Style/Semicolon - -\\"abc #{de} fghi #{jkl} mno\\" - -\\"abc\\" \\\\ - \\"def\\" \\\\ - \\"ghi\\" - -\\"abc #{\\"abc #{abc} abc\\"} abc\\" - -{ \\"a\\" => 1 } - -{ \\"a #{a}\\" => 1 } - -:\\"abc#{abc}abc\\" -:'abc#{abc}abc' - -\`abc\` -\`super_super_super_super_super_super_super_super_super_super_super_super_s_long\` -\` - super_super_super_super_super_super_super_super_super_super_super_super_s_long -\`.to_s - -<<-HERE -This is a straight heredoc! -HERE - -<<-HERE -This is another straight heredoc, this time with interpolation! -#{interpolation} -So interpolated right now. -HERE - -abc = <<-HERE -This is a straight heredoc on an assign! -HERE - -<<-PARENT -This is a straight heredoc! -#{<<-CHILD -Why do I do this -CHILD -} -PARENT - -<<~HERE - This is a squiggly heredoc! -HERE - -<<~HERE - This is another squiggly heredoc, this time with interpolation! - #{interpolation} - So interpolated right now. -HERE - -abc = <<~HERE - This is a squiggly heredoc on an assign! -HERE - -<<~PARENT - This is a squiggly heredoc! - #{<<~CHILD - Why do I do this - CHILD -} -PARENT - -<<-GRAND -#{\\"interpolated\\"} -<<~PARENT - #{\\"more interpolated\\"} - <<-CHILD - #{\\"what is going on\\"} - CHILD - #{\\"more interpolated\\"} -PARENT -#{\\"interpolated\\"} -GRAND - -\\"abc \\\\\\"abc\\\\\\" abc\\" - -foo_bar 1, 2, 3, <<-HERE - baz -HERE - -foo.bar 1, 2, 3, <<-HERE - baz -HERE - -foo_bar(1, 2, 3, <<-HERE) - baz -HERE - -foo_bar 1, 2, 3, <<-HERE, <<-THERE - here -HERE - there -THERE - -foo.bar 1, 2, 3, <<-HERE, <<-THERE - here -HERE - there -THERE - -foo_bar(1, 2, 3, <<-HERE, <<-THERE) - here -HERE - there -THERE - -# rubocop:enable Layout/ClosingParenthesisIndentation -# rubocop:enable Layout/SpaceInsideStringInterpolation -# rubocop:enable Lint/InterpolationCheck -# rubocop:enable Lint/LiteralInInterpolation, Layout/ClosingHeredocIndentation -# rubocop:enable Lint/Void, Layout/IndentHeredoc, Lint/UselessAssignment -# rubocop:enable Style/StringLiteralsInInterpolation -# rubocop:enable Style/UnneededInterpolation - -# rubocop:enable Lint/UnneededCopDisableDirective -" -`; diff --git a/test/cases/__snapshots__/super.test.js.snap b/test/cases/__snapshots__/super.test.js.snap deleted file mode 100644 index 162763c0..00000000 --- a/test/cases/__snapshots__/super.test.js.snap +++ /dev/null @@ -1,18 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`super.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -super - -super() - -super 1 - -super(1) - -super 1, 2 - -super(1, 2) -" -`; diff --git a/test/cases/__snapshots__/while.test.js.snap b/test/cases/__snapshots__/while.test.js.snap deleted file mode 100644 index 932b85fa..00000000 --- a/test/cases/__snapshots__/while.test.js.snap +++ /dev/null @@ -1,63 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`while.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -1 while a - -1 while a - -1 while super_super_super_super_super_super_super_super_super_super_super_long - -while super_super_super_super_super_super_super_super_super_super_super_supelong - 1 -end - -1 until a - -1 until a - -1 until super_super_super_super_super_super_super_super_super_super_super_long - -until super_super_super_super_super_super_super_super_super_super_super_supelong - 1 -end -" -`; - -exports[`while.rb matches expected output 2`] = ` -"# frozen_string_literal: true - -while a - 1 -end - -while a - 1 -end - -while super_super_super_super_super_super_super_super_super_super_super_long - 1 -end - -while super_super_super_super_super_super_super_super_super_super_super_supelong - 1 -end - -until a - 1 -end - -until a - 1 -end - -until super_super_super_super_super_super_super_super_super_super_super_long - 1 -end - -until super_super_super_super_super_super_super_super_super_super_super_supelong - 1 -end -" -`; diff --git a/test/cases/__snapshots__/yield.test.js.snap b/test/cases/__snapshots__/yield.test.js.snap deleted file mode 100644 index 8b0cde96..00000000 --- a/test/cases/__snapshots__/yield.test.js.snap +++ /dev/null @@ -1,20 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`yield.rb matches expected output 1`] = ` -"# frozen_string_literal: true - -[1, 2, 3].each do |i| - yield - - yield i - - yield(i) - - yield i, 2 - - yield(i, 2) - - yield -end -" -`; diff --git a/test/cases/alias.rb b/test/cases/alias.rb deleted file mode 100644 index a0c15833..00000000 --- a/test/cases/alias.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Style/GlobalVars -class AliasTest < Minitest::Test - def test_plain_alias - assert_equal 'plain alias', foo - end - - def test_global_alias - $bar = 'global alias' - assert_equal 'global alias', $foo - end - - private - - def baz - 'plain alias' - end - - alias bar baz # inline comment - alias :foo :bar - alias $foo $bar -end -# rubocop:enable Style/GlobalVars diff --git a/test/cases/alias.test.js b/test/cases/alias.test.js deleted file mode 100644 index 721f4c62..00000000 --- a/test/cases/alias.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("alias.rb"); diff --git a/test/cases/array.rb b/test/cases/array.rb deleted file mode 100644 index 8e514369..00000000 --- a/test/cases/array.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -class ArrayTest < Minitest::Test - def test_basics - assert_equal_join '', [] - assert_equal_join '1, 2, 3', [1, 2, 3] - assert_equal_join 'a, b, c', ['a', 'b', 'c'] - assert_equal_join 'a, b c, d', ['a', 'b c', 'd'] - assert_equal_join 'a, b, c', [:a, :b, :c] - assert_equal_join 'a, b c, d', [:a, :'b c', :d] - end - - def test_literals - assert_equal_join 'a, b, c', %w[a b c] - assert_equal_join 'a, b, c', %i[a b c] - end - - # rubocop:disable Style/UnneededInterpolation - def test_string_arrays_with_interpolation - interp = 'b' - assert_equal_join 'a, b, c', ['a', "#{interp}", 'c'] - end - # rubocop:enable Style/UnneededInterpolation - - def test_literals_with_interpolation - foo = 'foo' - bar = 'bar' - baz = 'baz' - - assert_equal_join 'afooa, bbarb, cbazc', %W[a#{foo}a b#{bar}b c#{baz}c] - assert_equal_join 'afooa, bbarb, cbazc', %I[a#{foo}a b#{bar}b c#{baz}c] - end - - # rubocop:disable Lint/UnneededSplatExpansion - def test_splats - assert_equal_join "1, 2, 3, 4, 5, 6", [1, 2, *[3, 4], 5, 6] - end - # rubocop:enable Lint/UnneededSplatExpansion - - def test_long_elements - super_super_super_super_super_super_long = 'foo' - arr = [ - super_super_super_super_super_super_long, - super_super_super_super_super_super_long, [ - super_super_super_super_super_super_long - ] - ] - - assert_equal_join('foo, foo, foo', arr) - end - - def test_reference - arr = %w[foo bar] - - assert_equal 'bar', arr[1] - end - - def test_reference_assignment - arr = %w[foo bar] - arr[1] = 'baz' - - assert_equal 'baz', arr[1] - end - - def test_comments_within_reference_assignment - arr = %w[foo bar] - arr[1] = [ - # abc - %w[abc] - ] - - assert_equal_join 'abc', arr[1] - end - - def test_dynamic_reference - arr = [1, 2, 3] - idx = 0 - - assert_equal 1, arr[idx] - end - - private - - def assert_equal_join(expected, object) - assert_equal expected, object.join(', ') - end - - def assert_equal_str(expected, object) - assert_equal expected, object.to_s - end -end diff --git a/test/cases/array.test.js b/test/cases/array.test.js deleted file mode 100644 index 2dd8eddd..00000000 --- a/test/cases/array.test.js +++ /dev/null @@ -1,2 +0,0 @@ -runCase("array.rb"); -runCase("array.rb", { addTrailingCommas: true }, "trailing-commas.yml"); diff --git a/test/cases/assign.rb b/test/cases/assign.rb deleted file mode 100644 index b59d9a13..00000000 --- a/test/cases/assign.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/UselessAssignment, Style/ParallelAssignment -# rubocop:disable Metrics/MethodLength -# rubocop:disable Metrics/AbcSize -# rubocop:disable Metrics/LineLength -# rubocop:disable Metrics/ClassLength - -class AssignTest < Minitest::Test - def test_assignment - a = 1 - assert_equal 1, a - - a = - begin - 2 - end - assert_equal 2, a - end - - def test_parallel_assignment - a, b, c = [1, 2, 3] - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - a = 1, 2, 3 - assert_equal [1, 2, 3], a - - a, b, c = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - (a, b, c) = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - ((a, b, c)) = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - (((a, b, c))) = 1, 2, 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - end - - def test_assign_with_splat_operator - a, *b = 1, 2, 3 - assert_equal 1, a - assert_equal [2, 3], b - - a, *b, c, d = 1, 2, 3 - assert_equal 1, a - assert_equal [], b - assert_equal 2, c - assert_equal 3, d - - a, * = 1, 2, 3 - assert_equal 1, a - - a = *a - assert_equal [1], a - - (a, b), c = [1, 2], 3 - assert_equal 1, a - assert_equal 2, b - assert_equal 3, c - - * = [1, 2, 3] - - *, a = [1, 2, 3] - assert_equal 3, a - end - - def test_or_equals_operator - a = 2 - a ||= 1 - assert_equal 2, a - end - - def test_long_variable_assignment - super_super_super_super_super_long = 'bar' - super_super_super_long, super_super_super_long, super_super_super_long = - super_super_super_super_super_long, super_super_super_super_super_long, super_super_super_super_super_long - assert_equal super_super_super_long, 'bar' - - a = 2 - a ||= super_super_super_super_super_super_super_super_super_super_super_super_long - assert_equal 2, a - - super_super_super_super_super_super_super_super_super_super_super_long = 'foo' - a = [ - super_super_super_super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_super_super_long - ] - - assert_equal ['foo', 'foo', 'foo'], a - end - - def test_assign_hash - super_super_super_super_super_super_super_super_super_super_long = 'foo' - - hash = { - a: super_super_super_super_super_super_super_super_super_super_long, - b: super_super_super_super_super_super_super_super_super_super_long, - c: super_super_super_super_super_super_super_super_super_super_long - } - - assert_equal({ a: 'foo', b: 'foo', c: 'foo' }, hash) - end - - def test_assign_with_sort - # rubocop:disable Lint/UnneededCopDisableDirective - # rubocop:disable Layout/MultilineMethodCallIndentation - super_super_super_super_long = 'baz' - - arr = [super_super_super_super_long, super_super_super_super_long].sort - assert_equal ['baz', 'baz'], arr - - arr = { a: super_super_super_super_long, b: super_super_super_super_long }.sort.to_h - assert_equal({ a: 'baz', b: 'baz' }, arr) - - # rubocop:enable Layout/MultilineMethodCallIndentation - # rubocop:enable Lint/UnneededCopDisableDirective - end - - def test_setter_methods - a = Struct.new(:a).new - - a.a = 1 - assert_equal 1, a.a - - super_super_super_long = - Struct.new(:super_super_super_super_super_super_super_long).new - - super_super_super_super_super_super_super_super_super_super_super_long = 1 - - super_super_super_long.super_super_super_super_super_super_super_long = - super_super_super_super_super_super_super_super_super_super_super_long - - assert_equal( - super_super_super_long.super_super_super_super_super_super_super_long, - 1 - ) - end -end - -# rubocop:enable Lint/UselessAssignment, Style/ParallelAssignment -# rubocop:enable Metrics/MethodLength -# rubocop:enable Metrics/AbcSize -# rubocop:enable Metrics/LineLength -# rubocop:enable Metrics/ClassLength \ No newline at end of file diff --git a/test/cases/assign.test.js b/test/cases/assign.test.js deleted file mode 100644 index f5f12ed7..00000000 --- a/test/cases/assign.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("assign.rb"); diff --git a/test/cases/binary.rb b/test/cases/binary.rb deleted file mode 100644 index d42c87cc..00000000 --- a/test/cases/binary.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class BinaryTest < Minitest::Test - def test_unbroken - value = true - - assert(value && value && value) - end - - def test_broken - super_super_super_super_super_long = true - - assert( - super_super_super_super_super_long && - super_super_super_super_super_long && - super_super_super_super_super_long - ) - end -end diff --git a/test/cases/binary.test.js b/test/cases/binary.test.js deleted file mode 100644 index 363cea84..00000000 --- a/test/cases/binary.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("binary.rb"); diff --git a/test/cases/blocks.rb b/test/cases/blocks.rb deleted file mode 100644 index eee9569f..00000000 --- a/test/cases/blocks.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/UnusedBlockArgument - -loop { 1 } - -loop do - 1 -end - -loop do - # foobar -end - -port ENV.fetch('PORT') { 3000 } - -test 'foobar' do -end - -te.st 'foobar' do -end - -test 'foobar' do - foobar -end - -te.st 'foobar' do - foobar -end - -test 'foobar' do |bar| - bar.to_s -end - -te.st 'foobar' do |bar| - bar.to_s -end - -loop { super_super_super_super_super_super_super_super_super_super_super_super_long } - -loop do - super_super_super_super_super_super_super_super_super_super_super_long -end - -loop { |i| 1 } - -loop { |i; j| 1 } - -loop do |i| - i -end - -loop { |*| i } - -loop { |(a, b)| i } - -loop { |a, (b, c), d, *e| i } - -loop { |i| super_super_super_super_super_super_super_super_super_super_super_super_long } - -loop do |i| - super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Metrics/LineLength -define_method :long_method_name_that_forces_overflow do |_some_long_argument_that_overflows = Time.now, _other_arg = nil| -end -# rubocop:enable Metrics/LineLength - -some_method.each do |foo| - bar - baz -end.to_i - -[ - super_super_super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_super_long -].to_s - -{ - a: 'super_super_super_super_super_super_super_super_super_super_long', - b: 'super_super_super_super_super_super_super_super_super_super_long' -}.to_s - -loop { |i| i.to_s } - -loop do |i| - i.to_s -end - -loop do |i| - i.to_s - i.next -end - -loop do |i| - i.to_s :db -end - -loop { |i, j| i.to_s } - -for i in [1, 2, 3] do - p i -end - -def change - change_table :foo do - column :bar - end -end - -foo 'foo' do |bar| - bar.to_s -end - -target.method object.map do |arg| - arg * 2 -end - -# from ruby test/ruby/test_call.rb -assert_nil(("a".sub! "b" do end&.foo {})) - -# rubocop:enable Lint/UnusedBlockArgument diff --git a/test/cases/blocks.test.js b/test/cases/blocks.test.js deleted file mode 100644 index 10b7486b..00000000 --- a/test/cases/blocks.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("blocks.rb"); diff --git a/test/cases/break.rb b/test/cases/break.rb deleted file mode 100644 index 1fde5f7f..00000000 --- a/test/cases/break.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -[].each { break } - -[].each { break 1 } - -[].each { break(1) } - -[].each { break 1, 2 } diff --git a/test/cases/break.test.js b/test/cases/break.test.js deleted file mode 100644 index cf4a78be..00000000 --- a/test/cases/break.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("break.rb"); diff --git a/test/cases/case.rb b/test/cases/case.rb deleted file mode 100644 index ccfae6e3..00000000 --- a/test/cases/case.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/EmptyWhen, Style/EmptyCaseCondition - -case -when a - 1 -end - -case a -when b - 1 -end - -case a -when b, c - 1 -end - -case a -when b -when c - 1 -end - -case a -when b - 1 -when c - 2 -end - -case a -when b - 1 -else - 2 -end - -# rubocop:enable Lint/EmptyWhen, Style/EmptyCaseCondition diff --git a/test/cases/case.test.js b/test/cases/case.test.js deleted file mode 100644 index 2d6ac625..00000000 --- a/test/cases/case.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("case.rb"); diff --git a/test/cases/class.rb b/test/cases/class.rb deleted file mode 100644 index 9da6eed5..00000000 --- a/test/cases/class.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -module Pret - module Tier - # object documentation - class Object; end - - # second object - # documentation - class Object - end - - # third object - # documentation - class Object - attr_accessor :foo - end - - class Object < BasicObject; end - - class Object < BasicObject - end - - class Object < BasicObject - # inside class documentation - attr_accessor :bar - end - - class SuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLongClassName; end - - module SuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLongModName; end - - class << self - # method documentation - def method1; end - - def method2; end - - def method3; end - - def method_with_a_long_name1; end - - def method_with_a_long_name2; end - - def method_with_a_long_name3; end - - undef method1 - undef method2, method3 - undef method_with_a_long_name1, method_with_a_long_name2, method_with_a_long_name3 - end - - module Prettier; end - - module Prettier - end - - module Prettier - # inside module documentation - attr_accessor :foo - end - end -end - -Pret::Tier::Object # rubocop:disable Lint/Void -Pret::TIER = 'config'.to_s - -::Pret::Tier::Object # rubocop:disable Lint/Void -::PRET = 'config'.to_s diff --git a/test/cases/class.test.js b/test/cases/class.test.js deleted file mode 100644 index 54dea449..00000000 --- a/test/cases/class.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("class.rb"); diff --git a/test/cases/comments.rb b/test/cases/comments.rb deleted file mode 100644 index b0863bb1..00000000 --- a/test/cases/comments.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# this is a comment at -# the beginning of the file -# rubocop:disable Lint/Void - -loop do - # this is the only statement - # inside this loop -end - -loop do - # this is the first statement - # inside this loop - foo -end - -loop do - foo - # this is the last statement - # inside this loop -end - -def foo - # these are the only statements - # inside this method -end - -class Foo - # these are the only statements - # inside this class -end - -module Foo - # these are the only statements - # inside this module -end - -module Foo - class Foo - def foo - # this comment is inside a method - end - - def bar - print message # this is an inline comment - end - - def self.foo - # this comment is inside a self method - end - end -end - -foo # this is an inline comment -bar # this is another inline comment - -foo 'bar' # this is an inline comment - -[ - # these are comments - # inside of an array - foo, - # inside of an array - bar -] - -{ - # these are comments - foo: 'bar', - # inside of a hash - bar: 'baz' -} - -foo. # inline comment inside of a dot - bar - -Foo.where( - foo: bar, - bar: baz - # This is a comment -).to_a.find { |foo| foo.foo == bar.foo } - -if foo - # this is a comment in an if - bar -end - -unless foo - # this is a comment in an unless - bar -end - -while foo - # this is a comment at the beginning of a while - bar -end - -while foo - bar - # this is a comment at the end of a while -end - -until foo - # this is a comment at the beginning of a until - bar -end - -until foo - bar - # this is a comment at the end of a until -end - -case foo -when bar - # this is a comment at the beginning of a when - 1 -when baz - 2 - # this is a comment at the end of a when -end - -begin - # comment at the beginning of a begin - 1 -rescue - # comment at the beginning of a rescue - 2 -ensure - # comment at the end of a rescue - 3 -end - -# rubocop:enable Lint/Void -# this is a comment -# at the end of the file - -__END__ - /‾‾‾‾‾\ /‾‾‾‾‾\ /‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾/ /‾‾‾‾‾\ - / /‾‾/ / / /‾‾/ / / /‾‾‾ ‾‾/ /‾‾ ‾‾/ /‾‾ ‾‾/ /‾‾ / /‾‾‾ / /‾‾/ / - / ‾‾‾ / / ‾‾‾_/ / _‾/ / / / / / / / _‾/ / ‾‾‾_/ - / /‾‾‾‾‾ / /‾\ \ / /__ / / / / __/ /_ / /__ / /‾\ \ -/_/ /_/ /_/ /____/ /_/ /_/ /_____/ /____/ /_/ /_/ diff --git a/test/cases/comments.test.js b/test/cases/comments.test.js deleted file mode 100644 index 912df6f1..00000000 --- a/test/cases/comments.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("comments.rb"); diff --git a/test/cases/conditionals.rb b/test/cases/conditionals.rb deleted file mode 100644 index 504006ab..00000000 --- a/test/cases/conditionals.rb +++ /dev/null @@ -1,112 +0,0 @@ -# frozen_string_literal: true - -if a - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Style/Not, Style/NegatedIf, Lint/EmptyExpression -if not a - b -end - -# from ruby test/ruby/test_not.rb -assert_equal(true, (not ())) -# rubocop:enable Style/Not, Style/NegatedIf, Lint/EmptyExpression - -if a - break # comment -end - -if a - -else - b -end - -if a - 1 -elsif b - 2 -end - -if a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -if a - 1 -elsif b - 2 -elsif c - 3 -else - 4 -end - -unless a - super_super_super_super_super_super_super_super_super_super_super_super_long -end - -# rubocop:disable Style/UnlessElse -unless a - super_super_super_super_super_super_super_super_super_super_super_long -else - super_super_super_super_super_super_super_super_super_super_super_super_long -end -# rubocop:enable Style/UnlessElse - -1 if a - -1 if super_super_super_super_super_super_super_super_super_super_super_super_long - -1 unless a - -1 unless super_super_super_super_super_super_super_super_super_super_super_suplong - -if a - 1 -else - 2 -end - -unless a - 1 -else - 2 -end - -a ? 1 : 2 -a ? super_super_super_super_super_super_super_super_super_super_super_long - : super_super_super_super_super_super_super_super_super_super_super_super_long - -if a - b 1 -else - b(2) -end - -if a - b(1) -else - b 2 -end - -a b do - if a - a 'foo' - else - b - end -end - -if Some::Constant.super_super_super_super_super_super_super_super_super_super_long - 1 -elsif Some::Constant.super_super_super_super_super_super_super_super_super_super_long - 2 -end - -unless Some::Constant.super_super_super_super_super_super_super_super_super_super_long - 1 -end diff --git a/test/cases/conditionals.test.js b/test/cases/conditionals.test.js deleted file mode 100644 index 70a83b89..00000000 --- a/test/cases/conditionals.test.js +++ /dev/null @@ -1,2 +0,0 @@ -runCase("conditionals.rb"); -runCase("conditionals.rb", { inlineConditionals: false }, "block-conditionals.yml"); diff --git a/test/cases/defined.rb b/test/cases/defined.rb deleted file mode 100644 index 711c2643..00000000 --- a/test/cases/defined.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/Void - -defined? a # first - -defined?(a) # second - -defined? super_super_super_super_super_super_super_super_super_super_super_super_long - -defined?(super_super_super_super_super_super_super_super_super_super_super_super_long) - -defined?( - super_super_super_super_super_super_super_super_super_super_super_super_long -) - -defined?(a) # third - -# rubocop:enable Lint/Void diff --git a/test/cases/defined.test.js b/test/cases/defined.test.js deleted file mode 100644 index c5e648ff..00000000 --- a/test/cases/defined.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("defined.rb"); diff --git a/test/cases/embdoc.rb b/test/cases/embdoc.rb deleted file mode 100644 index 38cb8fba..00000000 --- a/test/cases/embdoc.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Style/BlockComments - -=begin -this is - -some really - -long documentation -that is contained -in an embdoc -=end - -class Foo -=begin -this is an embdoc inside a class -=end -end - -module Foo - class Foo -=begin -this is an embdoc even more indented -=end - end -end - -# rubocop:enable Style/BlockComments diff --git a/test/cases/embdoc.test.js b/test/cases/embdoc.test.js deleted file mode 100644 index 43bc6d31..00000000 --- a/test/cases/embdoc.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("embdoc.rb"); diff --git a/test/cases/encoding.rb b/test/cases/encoding.rb deleted file mode 100644 index 4f072356..00000000 --- a/test/cases/encoding.rb +++ /dev/null @@ -1,11 +0,0 @@ -# -*- encoding: binary -*- -# frozen_string_literal: true - -# rubocop:disable Lint/Void, Style/AsciiComments - -# il était -:il_était -"ひらがな" -/ひらがな/ - -# rubocop:enable Lint/Void, Style/AsciiComments diff --git a/test/cases/encoding.test.js b/test/cases/encoding.test.js deleted file mode 100644 index a721f07e..00000000 --- a/test/cases/encoding.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("encoding.rb"); diff --git a/test/cases/hash.rb b/test/cases/hash.rb deleted file mode 100644 index 9e55c04e..00000000 --- a/test/cases/hash.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/Void - -{} - -{ a: 'a', b: 'b', c: 'c' } - -{ :a => 'a', :b => 'b', :c => 'c' } - -{ Foo => 1, Bar => 2 } - -{ - super_super_super_super_super_super_super_super_long: - super_super_super_super_super_super_super_super_long, - super_super_super_super_super_super_super_super_super_long: { - super_super_super_super_super_super_super_super_long: - super_super_super_super_super_super_super_super_long - } -} - -foo :abc => true # some comment - -foobar alpha: alpha, beta: beta, gamma: gamma, delta: delta, epsilon: epsilon, zeta: zeta -foobar(alpha: alpha, beta: beta, gamma: gamma, delta: delta, epsilon: epsilon, zeta: zeta) - -# rubocop:enable Lint/Void diff --git a/test/cases/hash.test.js b/test/cases/hash.test.js deleted file mode 100644 index 502d75b6..00000000 --- a/test/cases/hash.test.js +++ /dev/null @@ -1,2 +0,0 @@ -runCase("hash.rb"); -runCase("hash.rb", { preferHashLabels: false }, "hash-rockets.yml"); diff --git a/test/cases/hooks.rb b/test/cases/hooks.rb deleted file mode 100644 index c2cb8b2d..00000000 --- a/test/cases/hooks.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Style/BeginBlock, Style/EndBlock - -BEGIN { - p 'begin' -} - -BEGIN { p 'begin' } - -BEGIN { super_super_super_super_super_super_super_super_super_super_super_super_long } - -BEGIN { - super_super_super_super_super_super_super_super_super_super_super_super_long -} - -END { - p 'end' -} - -END { p 'end' } - -END { super_super_super_super_super_super_super_super_super_super_super_super_long } - -END { - super_super_super_super_super_super_super_super_super_super_super_super_long -} - -# rubocop:enable Style/BeginBlock, Style/EndBlock diff --git a/test/cases/hooks.test.js b/test/cases/hooks.test.js deleted file mode 100644 index 591c7ad2..00000000 --- a/test/cases/hooks.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("hooks.rb"); diff --git a/test/cases/interpreter b/test/cases/interpreter deleted file mode 100644 index 92cbd2f0..00000000 --- a/test/cases/interpreter +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -does(something) diff --git a/test/cases/interpreter.test.js b/test/cases/interpreter.test.js deleted file mode 100644 index 726eec53..00000000 --- a/test/cases/interpreter.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("interpreter"); diff --git a/test/cases/kwargs.rb b/test/cases/kwargs.rb deleted file mode 100644 index ddae5b00..00000000 --- a/test/cases/kwargs.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class KwargsTest < Minitest::Test - def test_kwargs - assert_equal 10, add(alpha: 1, beta: 2, gamma: 3, delta: 4) - - args = { alpha: 1, beta: 2, gamma: 3 } - assert_equal 10, add(**args, delta: 4) - end - - private - - def add(alpha:, beta:, gamma: 1, delta: 2) - alpha + beta + gamma + delta - end -end diff --git a/test/cases/kwargs.test.js b/test/cases/kwargs.test.js deleted file mode 100644 index 2caa0a07..00000000 --- a/test/cases/kwargs.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("kwargs.rb"); diff --git a/test/cases/lambda.rb b/test/cases/lambda.rb deleted file mode 100644 index 43a4bea8..00000000 --- a/test/cases/lambda.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - --> { 1 } - -->(a, b, c) { a + b + c } - --> { super_super_super_super_super_super_super_super_super_super_super_super_long } - -->(a, b, c) { a + b + c + super_super_super_super_super_super_super_super_super_long } - -a.(1, 2, 3) - -a.call(1, 2, 3) - -a[] - -a[1, 2, 3] - --> a { a } - --> () { 1 } - -command :foobar, ->(argument) { argument + argument } -comm.and :foobar, ->(argument) { argument + argument } - -command :fooooooooooooobaaaaaaarrrrr, ->(argument) { argument + argument + argument + argument + argument + argument } -comm.and :fooooooooooooobaaaaaaarrrrr, ->(argument) { argument + argument + argument + argument + argument + argument } - -# rubocop:disable Metrics/LineLength -command :fooooooooooooobaaaaaaarrrrr, ->(_fooooooooooooobaaaaaaarrrrr1, _fooooooooooooobaaaaaaarrrrr2, _fooooooooooooobaaaaaaarrrrr3) { true } -# rubocop:enable Metrics/LineLength diff --git a/test/cases/lambda.test.js b/test/cases/lambda.test.js deleted file mode 100644 index b2be3d07..00000000 --- a/test/cases/lambda.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("lambda.rb"); diff --git a/test/cases/layout.rb b/test/cases/layout.rb deleted file mode 100644 index 1c8e40ae..00000000 --- a/test/cases/layout.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/Void - -1 - -def foobar - 2 - - 3; 4; 5 - - - 6 -end - -7 -8 -9 - - -10 - -# rubocop:enable Lint/Void diff --git a/test/cases/layout.test.js b/test/cases/layout.test.js deleted file mode 100644 index fa3a6118..00000000 --- a/test/cases/layout.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("layout.rb"); diff --git a/test/cases/method.rb b/test/cases/method.rb deleted file mode 100644 index 3a4e739f..00000000 --- a/test/cases/method.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/DuplicateMethods, Lint/UnusedMethodArgument -# rubocop:disable Metrics/ParameterLists - -def foo; end - -def foo(); end - -def foo alpha -end - -def foo(alpha) -end - -def self.foo; end - -def self.foo(); end - -def self.foo alpha -end - -def self.foo(alpha) -end - -def foo(alpha, beta, *gamma, delta, epsilon:, zeta:, eta: 1, **theta, &block) - 'what' -end - -def foo(alpha:, beta:, gamma:, delta:, epsilon:, zeta:, eta:, theta:, iota:, kappa:, lambda:) - 'what' -end - -def foo(alpha); 1; end - -def foo(*); end - -def foo(**); end - -foo() - -foo(1) -foo(1, 2) -foo(1, 2, *abc) -foo(1, 2, *abc, 3, 4) -foo(aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, iiiiiii) -foo(aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, iiiiiii,) -foo(aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, &block) - -foo aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, iiiiiii -foo.foo aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, iiiiiii - -Foo::Bar::Baz.qux aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, iiiiiii -Foo::Bar::Baz.qux aaaaaaa, bbbbbbb, ccccccc, ddddddd, eeeeeee, fffffff, ggggggg, hhhhhhh, iiiiiii, &block - -foo(*bar) -foo(**baz) -foo(&block) - -foo(*bar, &block) -foo(**baz, &block) -foo(*bar, **baz, &block) - -foo(h: 1, **bar) -foo(**bar, h: 1) -foo(h: 1, **bar, i: 2) - -Foo::foo -foo&.foo - -# rubocop:enable Lint/DuplicateMethods, Lint/UnusedMethodArgument -# rubocop:enable Metrics/ParameterLists diff --git a/test/cases/method.test.js b/test/cases/method.test.js deleted file mode 100644 index 6eb9edbd..00000000 --- a/test/cases/method.test.js +++ /dev/null @@ -1,2 +0,0 @@ -runCase("method.rb"); -runCase("method.rb", { addTrailingCommas: true }, "trailing-commas.yml"); diff --git a/test/cases/next.rb b/test/cases/next.rb deleted file mode 100644 index 2d37f47c..00000000 --- a/test/cases/next.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class NextTest < Minitest::Test - def test_no_args - result = [1, 2, 3].map { next } - - assert_equal [nil, nil, nil], result - end - - def test_one_arg_no_parens - result = [1, 2, 3].map { next 1 } - - assert_equal [1, 1, 1], result - end - - def test_one_arg_with_parens - result = [1, 2, 3].map { next(1) } - - assert_equal [1, 1, 1], result - end - - def test_multi_args_no_parens - result = [1, 2, 3].map { next 1, 2 } - - assert_equal [[1, 2], [1, 2], [1, 2]], result - end -end diff --git a/test/cases/next.test.js b/test/cases/next.test.js deleted file mode 100644 index 64fb2cbc..00000000 --- a/test/cases/next.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("next.rb"); diff --git a/test/cases/numbers.rb b/test/cases/numbers.rb deleted file mode 100644 index cec76803..00000000 --- a/test/cases/numbers.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class NumbersTest < Minitest::Test - def test_numbers - assert_equal_str '123', 123 - assert_equal_str '-123', -123 - assert_equal_str '1123', 1_123 - assert_equal_str '-543', -543 - assert_equal_str '123456789123456789', 123_456_789_123_456_789 - end - - def test_floats - assert_equal_str '123.45', 123.45 - assert_equal_str '0.0012', 1.2e-3 - end - - def test_bases - assert_equal_str '43707', 0xaabb - assert_equal_str '255', 0o377 - assert_equal_str '-10', -0b1010 - assert_equal_str '9', 0b001_001 - end - - private - - def assert_equal_str(expected, value) - assert_equal expected, value.to_s - end -end diff --git a/test/cases/numbers.test.js b/test/cases/numbers.test.js deleted file mode 100644 index f446988c..00000000 --- a/test/cases/numbers.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("numbers.rb"); diff --git a/test/cases/ranges.rb b/test/cases/ranges.rb deleted file mode 100644 index 63cf92a8..00000000 --- a/test/cases/ranges.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/UselessAssignment - -dot2 = 1..2 # dot2 -dot3 = 3...4 # dot3 - -# rubocop:enable Lint/UselessAssignment diff --git a/test/cases/ranges.test.js b/test/cases/ranges.test.js deleted file mode 100644 index dd4721f3..00000000 --- a/test/cases/ranges.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("ranges.rb"); diff --git a/test/cases/regexp.rb b/test/cases/regexp.rb deleted file mode 100644 index 7ac01750..00000000 --- a/test/cases/regexp.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -class RegexpTest < Minitest::Test - def test_default - regexp = /abc/ - - assert_match regexp, 'abcde' - end - - def test_braces - regexp = %r{abc} - - assert_match regexp, 'abcde' - end - - def test_braces_with_slashes - regexp = %r{a/b/c} - - assert_match regexp, 'a/b/c/d/e' - end - - def test_slashes - regexp = %r/abc/ - - assert_match regexp, 'abcde' - end - - def test_brackets - regexp = %r[abc] - - assert_match regexp, 'abcde' - end - - def test_parens - regexp = %r(abc) - - assert_match regexp, 'abcde' - end - - def test_interpolation - inter = 'b' - regexp = /a#{inter}c/ - - assert_match regexp, 'abcde' - end - - def test_modifier - regexp = /abc/i - - assert_match regexp, 'ABCDE' - end - - def test_brace_modifier - regexp = %r{abc}i - - assert_match regexp, 'ABCDE' - end - - def test_global_interpolation - 'foo' =~ /foo/ - regexp = /#$&/ - - assert_match regexp, 'foobar' - end - - def test_float - float_pat = /\A - [[:digit:]]+ # 1 or more digits before the decimal point - (\. # Decimal point - [[:digit:]]+ # 1 or more digits after the decimal point - )? # The decimal point and following digits are optional - \Z/x - - assert_match float_pat, "12.56" - end -end diff --git a/test/cases/regexp.test.js b/test/cases/regexp.test.js deleted file mode 100644 index 9d4edc37..00000000 --- a/test/cases/regexp.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("regexp.rb"); diff --git a/test/cases/rescue.rb b/test/cases/rescue.rb deleted file mode 100644 index a81a4b39..00000000 --- a/test/cases/rescue.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -begin - 1 -rescue ArgumentError - retry -rescue NoMethodError => exception - puts exception - redo -rescue SyntaxError, NoMethodError - 2 -rescue SomeSuperSuperLongError, SomeOtherSuperSuperLongError, OneLastSuperLongError - 3 -rescue - 4 -else - 5 -ensure - 6 -end - -a rescue nil - -# from ruby spec/ruby/language/rescue_spec.rb -def foo - a -rescue A, *B => e - e -end diff --git a/test/cases/rescue.test.js b/test/cases/rescue.test.js deleted file mode 100644 index 75fa69a3..00000000 --- a/test/cases/rescue.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("rescue.rb"); diff --git a/test/cases/return.rb b/test/cases/return.rb deleted file mode 100644 index 4b4201b0..00000000 --- a/test/cases/return.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/UnneededCopDisableDirective -# rubocop:disable Style/GuardClause, Style/RedundantReturn - -def foo - return if a -end - -def bar - return 1 if a -end - -def baz - return(1) if a -end - -def qux - return 1, 2 if a -end - -def qax - return foo :bar if a -end - -# rubocop:enable Style/GuardClause, Style/RedundantReturn -# rubocop:enable Lint/UnneededCopDisableDirective diff --git a/test/cases/return.test.js b/test/cases/return.test.js deleted file mode 100644 index acf1de14..00000000 --- a/test/cases/return.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("return.rb"); diff --git a/test/cases/strings.rb b/test/cases/strings.rb deleted file mode 100644 index 08184918..00000000 --- a/test/cases/strings.rb +++ /dev/null @@ -1,167 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Lint/UnneededCopDisableDirective - -# rubocop:disable Layout/ClosingParenthesisIndentation -# rubocop:disable Layout/SpaceInsideStringInterpolation -# rubocop:disable Lint/InterpolationCheck -# rubocop:disable Lint/LiteralInInterpolation, Layout/ClosingHeredocIndentation -# rubocop:disable Lint/Void, Layout/IndentHeredoc, Lint/UselessAssignment -# rubocop:disable Style/StringLiteralsInInterpolation -# rubocop:disable Style/UnneededInterpolation - -?a # these are CHARs -?\C-a -?\M-a -?\M-\C-a - -'' - -'abc' - -"abc's" - -"abc" - -"abc\n" - -'\n' -"\n" -'\x0' -"\x0" -'#{"\n"}' -"#{"\n"}" -"#{'\n'}" -"#{'\n'}#{"\n"}" -"#{"\n#{'\n'}#{"\n"}\n"}#{'\n'}" - -"\M-\C-a" - -"abc #{super} abc" - -"#{abc} abc" - -"{\"abc\": \"foo\nbar\"}" - -# rubocop:disable Style/Semicolon -"abc #{foo; bar} abc" -# rubocop:enable Style/Semicolon - -"abc #{de} fghi #{jkl} mno" - -'abc' \ - 'def' \ - 'ghi' - -"abc #{"abc #{abc} abc"} abc" - -{ 'a' => 1 } - -{ "a #{a}" => 1 } - -:"abc#{abc}abc" -:'abc#{abc}abc' - -%x[abc] -%x[super_super_super_super_super_super_super_super_super_super_super_super_s_long] -%x[super_super_super_super_super_super_super_super_super_super_super_super_s_long].to_s - -<<-HERE -This is a straight heredoc! -HERE - -<<-HERE -This is another straight heredoc, this time with interpolation! -#{interpolation} -So interpolated right now. -HERE - -abc = <<-HERE -This is a straight heredoc on an assign! -HERE - -<<-PARENT -This is a straight heredoc! -#{ -<<-CHILD -Why do I do this -CHILD -} -PARENT - -<<~HERE - This is a squiggly heredoc! -HERE - -<<~HERE - This is another squiggly heredoc, this time with interpolation! - #{interpolation} - So interpolated right now. -HERE - -abc = <<~HERE - This is a squiggly heredoc on an assign! -HERE - -<<~PARENT - This is a squiggly heredoc! - #{ - <<~CHILD - Why do I do this - CHILD - } -PARENT - -<<-GRAND -#{'interpolated'} -<<~PARENT - #{'more interpolated'} - <<-CHILD - #{'what is going on'} - CHILD - #{'more interpolated'} -PARENT -#{'interpolated'} -GRAND - -'abc "abc" abc' - -foo_bar 1, 2, 3, <<-HERE - baz -HERE - -foo.bar 1, 2, 3, <<-HERE - baz -HERE - -foo_bar(1, 2, 3, <<-HERE) - baz -HERE - -foo_bar 1, 2, 3, <<-HERE, <<-THERE - here -HERE - there -THERE - -foo.bar 1, 2, 3, <<-HERE, <<-THERE - here -HERE - there -THERE - -foo_bar(1, 2, 3, <<-HERE, <<-THERE) - here -HERE - there -THERE - -# rubocop:enable Layout/ClosingParenthesisIndentation -# rubocop:enable Layout/SpaceInsideStringInterpolation -# rubocop:enable Lint/InterpolationCheck -# rubocop:enable Lint/LiteralInInterpolation, Layout/ClosingHeredocIndentation -# rubocop:enable Lint/Void, Layout/IndentHeredoc, Lint/UselessAssignment -# rubocop:enable Style/StringLiteralsInInterpolation -# rubocop:enable Style/UnneededInterpolation - -# rubocop:enable Lint/UnneededCopDisableDirective diff --git a/test/cases/strings.test.js b/test/cases/strings.test.js deleted file mode 100644 index 6288a53f..00000000 --- a/test/cases/strings.test.js +++ /dev/null @@ -1,2 +0,0 @@ -runCase("strings.rb"); -runCase("strings.rb", { preferSingleQuotes: false }, "double-quotes.yml"); diff --git a/test/cases/super.rb b/test/cases/super.rb deleted file mode 100644 index 7808b387..00000000 --- a/test/cases/super.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -super - -super() - -super 1 - -super(1) - -super 1, 2 - -super(1, 2) diff --git a/test/cases/super.test.js b/test/cases/super.test.js deleted file mode 100644 index d4bb70d3..00000000 --- a/test/cases/super.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("super.rb"); diff --git a/test/cases/while.rb b/test/cases/while.rb deleted file mode 100644 index 140c24cc..00000000 --- a/test/cases/while.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -while a - 1 -end - -1 while a - -while super_super_super_super_super_super_super_super_super_super_super_long - 1 -end - -1 while super_super_super_super_super_super_super_super_super_super_super_supelong - -until a - 1 -end - -1 until a - -until super_super_super_super_super_super_super_super_super_super_super_long - 1 -end - -1 until super_super_super_super_super_super_super_super_super_super_super_supelong diff --git a/test/cases/while.test.js b/test/cases/while.test.js deleted file mode 100644 index 909fd063..00000000 --- a/test/cases/while.test.js +++ /dev/null @@ -1,2 +0,0 @@ -runCase("while.rb"); -runCase("while.rb", { inlineLoops: false }, "block-loops.yml"); diff --git a/test/cases/yield.rb b/test/cases/yield.rb deleted file mode 100644 index d394e41f..00000000 --- a/test/cases/yield.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -[1, 2, 3].each do |i| - yield - - yield i - - yield(i) - - yield i, 2 - - yield(i, 2) - - yield -end diff --git a/test/cases/yield.test.js b/test/cases/yield.test.js deleted file mode 100644 index 79f676e6..00000000 --- a/test/cases/yield.test.js +++ /dev/null @@ -1 +0,0 @@ -runCase("yield.rb"); diff --git a/test/config/block-conditionals.yml b/test/config/block-conditionals.yml deleted file mode 100644 index ba0fc3b5..00000000 --- a/test/config/block-conditionals.yml +++ /dev/null @@ -1,4 +0,0 @@ -inherit_from: ./default.yml - -Style/IfUnlessModifier: - Enabled: false diff --git a/test/config/block-loops.yml b/test/config/block-loops.yml deleted file mode 100644 index 50ea6d07..00000000 --- a/test/config/block-loops.yml +++ /dev/null @@ -1,4 +0,0 @@ -inherit_from: ./default.yml - -Style/WhileUntilModifier: - Enabled: false diff --git a/test/config/default.yml b/test/config/default.yml deleted file mode 100644 index a6aaf1fe..00000000 --- a/test/config/default.yml +++ /dev/null @@ -1,5 +0,0 @@ -AllCops: - TargetRubyVersion: 2.5 - -Style/Documentation: - Enabled: false diff --git a/test/config/double-quotes.yml b/test/config/double-quotes.yml deleted file mode 100644 index 9b122d37..00000000 --- a/test/config/double-quotes.yml +++ /dev/null @@ -1,4 +0,0 @@ -inherit_from: ./default.yml - -Style/StringLiterals: - EnforcedStyle: double_quotes diff --git a/test/config/hash-rockets.yml b/test/config/hash-rockets.yml deleted file mode 100644 index 41364e3b..00000000 --- a/test/config/hash-rockets.yml +++ /dev/null @@ -1,4 +0,0 @@ -inherit_from: ./default.yml - -Style/HashSyntax: - EnforcedStyle: hash_rockets diff --git a/test/config/trailing-commas.yml b/test/config/trailing-commas.yml deleted file mode 100644 index 77143693..00000000 --- a/test/config/trailing-commas.yml +++ /dev/null @@ -1,10 +0,0 @@ -inherit_from: ./default.yml - -Style/TrailingCommaInArguments: - EnforcedStyleForMultiline: consistent_comma - -Style/TrailingCommaInArrayLiteral: - EnforcedStyleForMultiline: consistent_comma - -Style/TrailingCommaInHashLiteral: - EnforcedStyleForMultiline: consistent_comma diff --git a/test/errors.test.js b/test/errors.test.js deleted file mode 100644 index 7dc22ccd..00000000 --- a/test/errors.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const prettier = require("prettier"); - -const format = content => () => prettier.format(content, { - parser: "ruby", plugins: ["."] -}); - -test("alias errors throws on parsing", () => { - expect(format("alias $a $1")).toThrow("Invalid ruby"); -}); - -test("assignment errors", () => { - expect(format("self = 1")).toThrow("Invalid ruby"); -}); - -test("class creation errors", () => { - expect(format("class foo; end")).toThrow("Invalid ruby"); -}); - -test("argument type errors", () => { - expect(format("def foo($a); end")).toThrow("Invalid ruby"); -}); diff --git a/test/js/alias.test.js b/test/js/alias.test.js new file mode 100644 index 00000000..fdd0381e --- /dev/null +++ b/test/js/alias.test.js @@ -0,0 +1,13 @@ +describe("alias", () => { + test("bare word aliases", () => ( + expect("alias foo bar").toMatchFormat() + )); + + test("symbol aliases become bare word aliases", () => ( + expect("alias :foo :bar").toChangeFormat("alias foo bar") + )); + + test("global aliases", () => ( + expect("alias $foo $bar").toMatchFormat() + )); +}); diff --git a/test/js/array.test.js b/test/js/array.test.js new file mode 100644 index 00000000..f26f7ca6 --- /dev/null +++ b/test/js/array.test.js @@ -0,0 +1,90 @@ +const { long, ruby } = require("./utils"); + +describe("array", () => { + test("empty arrays", () => ( + expect("[]").toMatchFormat() + )); + + test("basic formatting", () => ( + expect("[1, 2, 3]").toMatchFormat() + )); + + test("transforms basic string arrays", () => ( + expect("['a', 'b', 'c', 'd', 'e']").toChangeFormat("%w[a b c d e]") + )); + + test("does not transform string arrays with spaces", () => ( + expect("['a', 'b c', 'd', 'e']").toMatchFormat() + )); + + test("does not transform string arrays with interpolation", () => ( + expect(`['a', "b#{c}d", 'e']`).toMatchFormat() + )); + + test("transforms basic symbol arrays", () => ( + expect("[:a, :b, :c]").toChangeFormat("%i[a b c]") + )); + + test("does not transform symbol arrays with dynamic symbols", () => ( + expect("[:'a + b']").toMatchFormat() + )); + + test("handles splats", () => ( + expect("[1, 2, *[3, 4], 5, 6]").toMatchFormat() + )); + + test("breaks appropriately", () => { + const contents = ruby(` + [ + ${long}, + ${long}, + [ + ${long}, + ${long}, + ${long} + ] + ] + `); + + return expect(contents).toMatchFormat(); + }); + + test("adds trailing commas when requested", () => { + const before = `[${long}, ${long}, ${long}]`; + const after = `[\n ${long},\n ${long},\n ${long},\n]`; + + return expect(before).toChangeFormat(after, { addTrailingCommas: true }); + }); + + test("literal reference", () => ( + expect("array[5]").toMatchFormat() + )); + + test("dynamic reference", () => ( + expect("array[idx]").toMatchFormat() + )); + + test("literal assignment", () => ( + expect("array[5] = 6").toMatchFormat() + )); + + test("dynamic assignment", () => ( + expect("array[idx] = 6").toMatchFormat() + )); + + test("comments within assignment", () => { + const contents = ruby(` + array = %w[foo bar] + array[1] = [ + # abc + %w[abc] + ] + `); + + return expect(contents).toMatchFormat(); + }); + + test("breaking maintains calls on the end", () => ( + expect(`[${long}].freeze`).toChangeFormat(`[\n ${long}\n].freeze`) + )); +}); diff --git a/test/js/assign.test.js b/test/js/assign.test.js new file mode 100644 index 00000000..0fd9fda0 --- /dev/null +++ b/test/js/assign.test.js @@ -0,0 +1,132 @@ +const { long, ruby } = require("./utils"); + +describe("assign", () => { + describe("single assignment", () => { + test("basic", () => ( + expect("a = 1").toMatchFormat() + )); + + test("multiline", () => { + const content = ruby(` + a = + begin + 1 + end + `); + + return expect(content).toMatchFormat(); + }); + + test("other operator", () => ( + expect("a ||= b").toMatchFormat() + )); + }); + + describe("multiple assignment", () => { + test("multi on left, multi on right", () => ( + expect("a, b, c = 1, 2, 3").toMatchFormat() + )); + + test("single on left, multi on right", () => ( + expect("a = 1, 2, 3").toMatchFormat() + )); + + test("multi on left, array on right", () => ( + expect("a, b, c = [1, 2, 3]").toMatchFormat() + )); + + test("parens on left, multi on right", () => ( + expect("(a, b, c) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3") + )); + + test("double parens on left, multi on right", () => ( + expect("((a, b, c)) = 1, 2, 3").toChangeFormat("a, b, c = 1, 2, 3") + )); + + test("parens on some of left, multi on right", () => ( + expect("(a, b), c = [1, 2], 3").toMatchFormat() + )); + }); + + describe("multiple assignment with splat", () => { + test("after ident", () => ( + expect("a, *b = 1, 2, 3").toMatchFormat() + )); + + test("between idents", () => ( + expect("a, *b, c, d = 1, 2, 3").toMatchFormat() + )); + + test("with no name", () => ( + expect("a, * = 1, 2, 3").toMatchFormat() + )); + + test("on right side", () => ( + expect("a = *a").toMatchFormat() + )); + + test("only on left side", () => ( + expect("* = [1, 2, 3]").toMatchFormat() + )); + + test("and then ident on left side", () => ( + expect("*, a = [1, 2, 3]").toMatchFormat() + )); + }); + + describe("breaking", () => { + test("inline becomes multi line", () => ( + expect(`${long} = ${long}`).toChangeFormat(`${long} =\n ${long}`) + )); + + test("arrays don't get force indented", () => ( + expect(`a = [${long}, ${long}, ${long}]`).toChangeFormat(ruby(` + a = [ + ${long}, + ${long}, + ${long} + ] + `)) + )); + + test("hashes don't get force indented", () => ( + expect(`a = { a: ${long}, b: ${long}, c: ${long} }`).toChangeFormat(ruby(` + a = { + a: + ${long}, + b: + ${long}, + c: + ${long} + } + `)) + )); + + test("chained methods on array literals don't get oddly indented", () => ( + expect(`a = [${long}].freeze`).toChangeFormat(ruby(` + a = [ + ${long} + ].freeze + `)) + )); + + test("chained methods on hash literals don't get oddly indented", () => ( + expect(`a = { a: ${long} }.freeze`).toChangeFormat(ruby(` + a = { + a: + ${long} + }.freeze + `)) + )); + }); + + describe("constants", () => { + test("assigning to constant", () => ( + expect("Pret::TIER = 'config'").toMatchFormat() + )); + + test("assigning to top level constants", () => ( + expect("::PRETTIER = 'config'").toMatchFormat() + )); + }); +}); diff --git a/test/js/binary.test.js b/test/js/binary.test.js new file mode 100644 index 00000000..a8ccb58f --- /dev/null +++ b/test/js/binary.test.js @@ -0,0 +1,13 @@ +const { long } = require("./utils"); + +describe("binary", () => { + test("single line", () => ( + expect("foo && bar && baz").toMatchFormat() + )); + + test("multi line", () => ( + expect(`${long} && ${long} && ${long}`).toChangeFormat( + `${long} &&\n ${long} &&\n ${long}` + ) + )); +}); diff --git a/test/js/blocks.test.js b/test/js/blocks.test.js new file mode 100644 index 00000000..b017567b --- /dev/null +++ b/test/js/blocks.test.js @@ -0,0 +1,176 @@ +const { long, ruby } = require("./utils"); + +describe("blocks", () => { + test("empty", () => ( + expect("loop {}").toMatchFormat() + )); + + test("single line non-breaking", () => ( + expect("loop { 1 }").toMatchFormat() + )); + + test("single line breaking", () => ( + expect(`loop { ${long} }`).toChangeFormat(`loop do\n ${long}\nend`) + )); + + test("multi line non-breaking", () => ( + expect("loop do\n 1\nend").toChangeFormat("loop { 1 }") + )); + + test("multi-line breaking", () => ( + expect(`loop do\n ${long}\nend`).toMatchFormat() + )); + + test("multi-line with comment", () => ( + expect("loop do\n # foobar\nend").toMatchFormat() + )); + + test("multi-line on command, no body", () => ( + expect("command 'foobar' do\nend").toMatchFormat() + )); + + test("multi-line on command call, no body", () => ( + expect("command.call 'foobar' do\nend").toMatchFormat() + )); + + test("multi-line on command, with body", () => ( + expect("command 'foobar' do\n foo\nend").toMatchFormat() + )); + + test("multi-line on command call, with body", () => ( + expect("command.call 'foobar' do\n foo\nend").toMatchFormat() + )); + + test("breaking maintains calls on the end", () => { + const content = ruby(` + method.each do |foo| + bar + baz + end.to_i + `); + + return expect(content).toMatchFormat(); + }); + + test("for loops get changed", () => { + const content = ruby(` + for i in [1, 2, 3] do + p i + end + `); + + return expect(content).toChangeFormat(ruby(` + [1, 2, 3].each do |i| + p i + end + `)); + }); + + // from ruby test/ruby/test_call.rb + test("inline do end", () => ( + expect(`assert_nil(("a".sub! "b" do end&.foo {}))`).toChangeFormat(ruby(` + assert_nil( + ( + 'a'.sub! 'b' do + end&.foo do + end + ) + ) + `)) + )); + + describe("args", () => { + test("no body", () => ( + expect("loop { |i| }").toMatchFormat() + )); + + test("single line non-breaking", () => ( + expect("loop { |i| 1 }").toMatchFormat() + )); + + test("single line breaking", () => ( + expect(`loop { |i| ${long} }`).toChangeFormat( + `loop do |i|\n ${long}\nend` + ) + )); + + test("multi-line non-breaking", () => ( + expect("loop do |i|\n i\nend").toChangeFormat("loop { |i| i }") + )); + + test("multi-line breaking", () => ( + expect(`loop do |i|\n ${long}\nend`).toMatchFormat() + )); + + test("block-local args", () => ( + expect("loop { |i; j| 1 }").toMatchFormat() + )); + + test("splat", () => ( + expect("loop { |*| i }").toMatchFormat() + )); + + test("destructure", () => ( + expect("loop { |(a, b)| i }").toMatchFormat() + )); + + test("lots of args types", () => ( + expect("loop { |a, (b, c), d, *e| i }").toMatchFormat() + )); + + test("does not split up args inside pipes", () => ( + expect(`loop do |${long} = 1, a${long} = 2|\nend`).toMatchFormat() + )); + + if (process.env.RUBY_VERSION >= "2.7") { + test("number args", () => ( + expect("loop { @1 * 2 }").toMatchFormat() + )); + } + }); + + describe("to_proc transform", () => { + test("basic", () => ( + expect("loop { |i| i.to_s }").toChangeFormat("loop(&:to_s)") + )); + + test("happens for command nodes", () => { + const content = ruby(` + command 'foo' do |bar| + bar.to_s + end + `); + + return expect(content).toChangeFormat("command 'foo', &:to_s"); + }); + + test("happens for command call nodes", () => { + const content = ruby(` + command.call 'foo' do |bar| + bar.to_s + end + `); + + return expect(content).toChangeFormat("command.call 'foo', &:to_s"); + }); + + test("does not happen when there are multiple lines", () => { + const content = ruby(` + loop do |i| + i.to_s + i.next + end + `); + + return expect(content).toMatchFormat(); + }); + + test("does not happen when there are args to the method call", () => ( + expect("loop { |i| i.to_s(:db) }").toMatchFormat() + )); + + test("does not happen when there are multiple args", () => ( + expect("loop { |i, j| i.to_s }").toMatchFormat() + )); + }); +}); diff --git a/test/js/break.test.js b/test/js/break.test.js new file mode 100644 index 00000000..aa196b7d --- /dev/null +++ b/test/js/break.test.js @@ -0,0 +1,17 @@ +describe("break", () => { + test("empty break", () => ( + expect("break").toMatchFormat() + )); + + test("break with one argument, no parens", () => ( + expect("break 1").toMatchFormat() + )); + + test("break with parens drops parens", () => ( + expect("break(1)").toChangeFormat("break 1") + )); + + test("break with multiple arguments", () => ( + expect("break 1, 2, 3").toMatchFormat() + )); +}); diff --git a/test/js/case.test.js b/test/js/case.test.js new file mode 100644 index 00000000..909817ed --- /dev/null +++ b/test/js/case.test.js @@ -0,0 +1,40 @@ +const { long, ruby } = require("./utils"); + +describe("case", () => { + test("empty case", () => ( + expect("case\nwhen a\n 1\nend").toMatchFormat() + )); + + test("single when", () => ( + expect("case a\nwhen b\n 1\nend").toMatchFormat() + )); + + test("multiple predicates, one when", () => ( + expect("case a\nwhen b, c\n 1\nend").toMatchFormat() + )); + + test("breaking with multiple predicates, one when", () => { + const content = ruby(` + case foo + when '${long}', + 'a${long}', + 'b${long}' + bar + end + `); + + return expect(content).toMatchFormat(); + }); + + test("multiple consecutive whens", () => ( + expect("case a\nwhen b\nwhen c\n 1\nend").toMatchFormat() + )); + + test("basic multiple branches", () => ( + expect("case a\nwhen b\n 1\nwhen c\n 2\nend").toMatchFormat() + )); + + test("else clauses", () => ( + expect("case a\nwhen b\n 1\nelse\n 2\nend").toMatchFormat() + )); +}); diff --git a/test/js/class.test.js b/test/js/class.test.js new file mode 100644 index 00000000..171db677 --- /dev/null +++ b/test/js/class.test.js @@ -0,0 +1,71 @@ +const { long, ruby } = require("./utils"); + +describe("class", () => { + test("basic nesting", () => { + const content = ruby(` + module Pret + module Tier + class Plugin; end + module Ruby; end + end + end + `); + + return expect(content).toMatchFormat(); + }); + + test("inheritance", () => { + const content = ruby(` + module Prettier + class Ruby < Object; end + end + `); + + return expect(content).toMatchFormat(); + }); + + test("breaking class name", () => ( + expect(`class P${long}; end`).toChangeFormat(`class P${long}\nend`) + )); + + test("breaking module name", () => ( + expect(`module P${long}; end`).toChangeFormat(`module P${long}\nend`) + )); + + test("class push blocks", () => { + const content = ruby(` + class << Prettier + def foo; end + end + `); + + return expect(content).toMatchFormat(); + }); + + describe("undef", () => { + test("single inline", () => ( + expect("undef foo").toMatchFormat() + )); + + test("multiple inline", () => ( + expect("undef foo, bar").toMatchFormat() + )); + + test("multiple breaking", () => ( + expect(`undef ${long}, a${long}`).toChangeFormat(ruby(` + undef ${long}, + a${long} + `)) + )); + }); + + describe("constant reference", () => { + test("regular", () => ( + expect("Pret::Tier::Ruby").toMatchFormat() + )); + + test("top-level", () => ( + expect("::Pret::Tier::Ruby").toMatchFormat() + )); + }); +}); diff --git a/test/js/comments.test.js b/test/js/comments.test.js new file mode 100644 index 00000000..ff5f0b6e --- /dev/null +++ b/test/js/comments.test.js @@ -0,0 +1,214 @@ +const { ruby } = require("./utils"); + +describe("comments", () => { + describe("on their own line", () => { + test("at the beginning of the file", () => { + const content = ruby(` + # this is a comment at + # the beginning of the file + + a = 1 + `); + + return expect(content).toMatchFormat(); + }); + + test("at the end of the file", () => { + const content = ruby(` + a = 1 + + # this is a comment at + # the end of the file + `); + + return expect(content).toMatchFormat(); + }); + + const commentBlocks = [ + "loop do", + "def foo", + "def self.foo", + "class Foo", + "module Foo", + "class << self", + "if foo", + "unless foo", + "while foo", + "until foo" + ]; + + describe.each(commentBlocks)("%s blocks", start => { + test("as the only statement", () => { + const content = ruby(` + ${start} + # this is the only statement + # inside this block + end + `); + + return expect(content).toMatchFormat(); + }); + + test("as the first statement", () => { + const content = ruby(` + ${start} + # this is the first statement + # inside this block + foo + end + `); + + return expect(content).toMatchFormat(); + }); + + test("as the last statement", () => { + const content = ruby(` + ${start} + foo + # this is the last statement + # inside this block + end + `); + + return expect(content).toMatchFormat(); + }); + }); + + test.skip("if/elsif/else/end statements", () => { + const content = ruby(` + if a + # this is the only comment in this if + elsif b + # this is the only comment in this elsif + elsif c + # this is a comment at the beginning of this elsif + 1 + elsif d + 2 + # this is a comment at the end of an elsif + else + # this is the only comment in this else + end + `); + + return expect(content).toMatchFormat(); + }); + + test("case/when/end statements", () => { + const content = ruby(` + case foo + when bar + # this is a comment at the beginning of a when + 1 + when baz + 2 + # this is a comment at the end of a when + when qux + # this is the only statement in this when + else + # this is the only statement in this else + end + `); + + return expect(content).toMatchFormat(); + }); + + test.skip("begin/rescue/ensure/end statements", () => { + const content = ruby(` + begin + # this is the only statement in this begin + rescue FooError + # this is the only statement in this rescue + rescue BarError + # this is the first statement of this rescue + 1 + rescue BazError + 2 + # this is the last statement of this rescue + ensure + # this is the only statement in this ensure + end + `); + + return expect(content).toMatchFormat(); + }); + + /* eslint-disable no-useless-escape */ + test("end content", () => { + const content = ruby(` + a = 1 + + __END__ + /‾‾‾‾‾\ /‾‾‾‾‾\ /‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾‾‾/ /‾‾‾‾/ /‾‾‾‾‾\ + / /‾‾/ / / /‾‾/ / / /‾‾‾ ‾‾/ /‾‾ ‾‾/ /‾‾ ‾‾/ /‾‾ / /‾‾‾ / /‾‾/ / + / ‾‾‾ / / ‾‾‾_/ / _‾/ / / / / / / / _‾/ / ‾‾‾_/ + / /‾‾‾‾‾ / /‾\ \ / /__ / / / / __/ /_ / /__ / /‾\ \ + /_/ /_/ /_/ /____/ /_/ /_/ /_____/ /____/ /_/ /_/ + `); + + return expect(content).toMatchFormat(); + }); + }); + + describe("inline", () => { + test("basic", () => ( + expect("foo # this is an inline comment").toMatchFormat() + )); + + test("commands", () => ( + expect("command 'foo' # this is an inline comment").toMatchFormat() + )); + + test("command calls", () => ( + expect("command.call 'foo' # this is an inline comment").toMatchFormat() + )); + }); + + describe("arrays", () => { + test("on their own lines", () => { + const content = ruby(` + [ + # these are comments + # inside of an array + foo, + # an then some more + bar + ] + `); + + return expect(content).toMatchFormat(); + }); + }); + + describe("hashes", () => { + test("on their own lines", () => { + const content = ruby(` + { + # these are comments + # inside of a hash + foo: 'bar', + # and then some more + bar: 'baz' + } + `); + + return expect(content).toMatchFormat(); + }); + }); + + describe("method calls", () => { + test.skip("on their own lines", () => { + const content = ruby(` + foo.bar( + # this is a comment at the beginning of the method call + foo: bar, + # this is a comment in the middle of the method call + bar: baz + # this is a comment at the end of the method call + ) + `); + + return expect(content).toMatchFormat(); + }); + }); +}); diff --git a/test/js/conditionals.test.js b/test/js/conditionals.test.js new file mode 100644 index 00000000..518c5ca5 --- /dev/null +++ b/test/js/conditionals.test.js @@ -0,0 +1,265 @@ +const { long, ruby } = require("./utils"); + +describe("conditionals", () => { + // from ruby test/ruby/test_not.rb + test("not operator, empty parens", () => ( + expect("assert_equal(true, (not ()))").toMatchFormat() + )); + + describe("when inline allowed", () => { + describe.each(["if", "unless"])("%s keyword", keyword => { + test("inline stays", () => ( + expect(`1 ${keyword} a`).toMatchFormat() + )); + + test("multi line changes", () => ( + expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`) + )); + + test("inline breaking changes", () => ( + expect(`${long} ${keyword} ${long}`).toChangeFormat( + `${keyword} ${long}\n ${long}\nend` + ) + )); + + test("multi line breaking stays", () => ( + expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat() + )); + + test("not operator", () => ( + expect(`b ${keyword} not a`).toMatchFormat() + )); + + test("empty first body", () => { + const content = ruby(` + ${keyword} a + + else + b + end + `); + + return expect(content).toMatchFormat(); + }); + + test.skip("comment in body", () => { + const content = ruby(` + ${keyword} a + # comment + end + `); + + return expect(content).toMatchFormat(); + }); + + test.skip("comment on node in body", () => { + const content = ruby(` + ${keyword} a + break # comment + end + `); + + return expect(content).toMatchFormat(); + }); + }); + }); + + describe("when inline not allowed", () => { + describe.each(["if", "unless"])("%s keyword", keyword => { + test("inline changes", () => ( + expect(`1 ${keyword} a`).toChangeFormat(`${keyword} a\n 1\nend`, { + inlineConditionals: false + }) + )); + + test("multi line stays", () => ( + expect(`${keyword} a\n 1\nend`).toMatchFormat({ + inlineConditionals: false + }) + )); + + test("inline breaking changes", () => ( + expect(`${long} ${keyword} ${long}`).toChangeFormat( + `${keyword} ${long}\n ${long}\nend`, + { inlineConditionals: false } + ) + )); + + test("multi line breaking stays", () => ( + expect(`${keyword} ${long}\n ${long}\nend`).toMatchFormat({ + inlineConditionals: false + }) + )); + + test("not operator", () => ( + expect(`${keyword} not a\n b\nend`).toMatchFormat({ + inlineConditionals: false + }) + )); + + test("empty first body", () => { + const content = ruby(` + ${keyword} a + + else + b + end + `); + + return expect(content).toMatchFormat({ inlineConditionals: false }); + }); + + test("comment in body", () => { + const content = ruby(` + ${keyword} a + # comment + end + `); + + return expect(content).toMatchFormat({ inlineConditionals: false }); + }); + + test("comment on node in body", () => { + const content = ruby(` + ${keyword} a + break # comment + end + `); + + return expect(content).toMatchFormat({ inlineConditionals: false }); + }); + }); + }); + + describe("ternaries", () => { + test("non-breaking", () => ( + expect("a ? 1 : 2").toMatchFormat() + )); + + test("breaking", () => ( + expect(`a ? ${long} : ${long}`).toChangeFormat(ruby(` + if a + ${long} + else + ${long} + end + `)) + )); + + test("transform from if/else", () => { + const content = ruby(` + if a + 1 + else + 2 + end + `); + + return expect(content).toChangeFormat("a ? 1 : 2"); + }); + + test("transform for unless/else", () => { + const content = ruby(` + unless a + 1 + else + 2 + end + `); + + return expect(content).toChangeFormat("a ? 2 : 1"); + }); + + describe("unable to transform", () => { + test("breaking", () => { + const content = ruby(` + if a + ${long} + else + ${long} + end + `); + + return expect(content).toMatchFormat(); + }); + + test("command in if body", () => { + const content = ruby(` + if a + b 1 + else + b(2) + end + `); + + return expect(content).toMatchFormat(); + }); + + test("command in else body", () => { + const content = ruby(` + if a + b(1) + else + b 2 + end + `); + + return expect(content).toMatchFormat(); + }); + + test("command call in if body", () => { + const content = ruby(` + if a + b.b 1 + else + b(2) + end + `); + + return expect(content).toMatchFormat(); + }); + + test("command call in else body", () => { + const content = ruby(` + if a + b(1) + else + b.b 2 + end + `); + + return expect(content).toMatchFormat(); + }); + }); + }); + + describe("if/elsif/else chains", () => { + test("basic", () => { + const content = ruby(` + if a + 1 + elsif b + 2 + end + `); + + return expect(content).toMatchFormat(); + }); + + test("multiple clauses", () => { + const content = ruby(` + if a + 1 + elsif b + 2 + elsif c + 3 + else + 4 + end + `); + + return expect(content).toMatchFormat(); + }); + }); +}); diff --git a/test/js/defined.test.js b/test/js/defined.test.js new file mode 100644 index 00000000..5102122e --- /dev/null +++ b/test/js/defined.test.js @@ -0,0 +1,27 @@ +const { long } = require("./utils"); + +describe("defined", () => { + test("no parens", () => ( + expect("defined? a").toChangeFormat("defined?(a)") + )); + + test("parens", () => ( + expect("defined?(a)").toMatchFormat() + )); + + test("breaks on long identifier, no parens", () => ( + expect(`defined? ${long}`).toChangeFormat(`defined?(\n ${long}\n)`) + )); + + test("breaks on long identifier, with parens", () => ( + expect(`defined?(${long})`).toChangeFormat(`defined?(\n ${long}\n)`) + )); + + test("breaking keeps breaking", () => ( + expect(`defined?(\n ${long}\n)`).toMatchFormat() + )); + + test("unnecessary breaking reverts to inline", () => ( + expect("defined?(\n a\n)").toChangeFormat("defined?(a)") + )); +}); diff --git a/test/js/embdoc.test.js b/test/js/embdoc.test.js new file mode 100644 index 00000000..3b74b121 --- /dev/null +++ b/test/js/embdoc.test.js @@ -0,0 +1,45 @@ +const { ruby } = require("./utils"); + +describe("embdoc", () => { + test("basic embdocs", () => { + const content = ruby(` + =begin + this is + + some really + + long documentation + that is contained + in an embdoc + =end + `); + + return expect(content).toMatchFormat(); + }); + + test("within a class", () => { + const content = ruby(` + class Foo + =begin + this is an embdoc inside a class + =end + end + `); + + return expect(content).toMatchFormat(); + }); + + test("within a nested class", () => { + const content = ruby(` + module Foo + class Foo + =begin + this is an embdoc even more indented + =end + end + end + `); + + return expect(content).toMatchFormat(); + }); +}); diff --git a/test/js/encoding.test.js b/test/js/encoding.test.js new file mode 100644 index 00000000..5d8bae8c --- /dev/null +++ b/test/js/encoding.test.js @@ -0,0 +1,19 @@ +describe("encoding", () => { + const header = "# -*- encoding: binary -*-"; + + test("comments", () => ( + expect(`${header}\n# il était`).toMatchFormat() + )); + + test("symbol literals", () => ( + expect(`${header}\n:il_était`).toMatchFormat() + )); + + test("string literals", () => ( + expect(`${header}\n'ひらがな'`).toMatchFormat() + )); + + test("regexp literals", () => ( + expect(`${header}\n/ひらがな/`).toMatchFormat() + )); +}); diff --git a/test/js/errors.test.js b/test/js/errors.test.js new file mode 100644 index 00000000..177b464e --- /dev/null +++ b/test/js/errors.test.js @@ -0,0 +1,25 @@ +describe("errors", () => { + test("invalid ruby", () => ( + expect("<>").toFailFormat() + )); + + test("alias errors throws on parsing", () => { + expect("alias $a $1").toFailFormat( + "can't make alias for the number variables" + ); + }); + + test("assignment errors", () => { + expect("self = 1").toFailFormat("Can't set variable"); + }); + + test("class creation errors", () => { + expect("class foo; end").toFailFormat("class/module name must be CONSTANT"); + }); + + test("argument type errors", () => { + expect("def foo($a); end").toFailFormat( + "formal argument cannot be a global variable" + ); + }); +}); diff --git a/test/escapePattern.test.js b/test/js/escapePattern.test.js similarity index 95% rename from test/escapePattern.test.js rename to test/js/escapePattern.test.js index 882b0950..d72f7ccf 100644 --- a/test/escapePattern.test.js +++ b/test/js/escapePattern.test.js @@ -1,4 +1,4 @@ -const escapePattern = require("../src/escapePattern"); +const escapePattern = require("../../src/escapePattern"); describe("escape sequences", () => { const should = value => string => ( diff --git a/test/js/files.test.js b/test/js/files.test.js new file mode 100644 index 00000000..9b0cd399 --- /dev/null +++ b/test/js/files.test.js @@ -0,0 +1,13 @@ +describe("files", () => { + test("handles full files that match", () => ( + expect("files/Gemfile").toInferRubyParser() + )); + + test("handles shebangs that match", () => ( + expect("files/shebang").toInferRubyParser() + )); + + test("handles extensions that match", () => ( + expect("files/test.rake").toInferRubyParser() + )); +}); diff --git a/test/cases/Gemfile.lock b/test/js/files/Gemfile similarity index 100% rename from test/cases/Gemfile.lock rename to test/js/files/Gemfile diff --git a/test/js/files/shebang b/test/js/files/shebang new file mode 100755 index 00000000..49ffd26f --- /dev/null +++ b/test/js/files/shebang @@ -0,0 +1 @@ +#!/usr/bin/env ruby diff --git a/test/js/files/test.rake b/test/js/files/test.rake new file mode 100644 index 00000000..e69de29b diff --git a/test/hasPragma.test.js b/test/js/hasPragma.test.js similarity index 85% rename from test/hasPragma.test.js rename to test/js/hasPragma.test.js index c9acc47e..3d52f0c3 100644 --- a/test/hasPragma.test.js +++ b/test/js/hasPragma.test.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { hasPragma } = require("../src/ruby").parsers.ruby; +const { hasPragma } = require("../../src/ruby").parsers.ruby; describe("hasPragma", () => { test("checks for @prettier comments", () => { diff --git a/test/js/hash.test.js b/test/js/hash.test.js new file mode 100644 index 00000000..87fc8153 --- /dev/null +++ b/test/js/hash.test.js @@ -0,0 +1,129 @@ +const { long, ruby } = require("./utils"); + +describe("hash", () => { + test("empty", () => ( + expect("{}").toMatchFormat() + )); + + test("breaking", () => { + const content = ruby(` + { + ${long}: + ${long}, + ${long}: { + ${long}: + ${long} + } + } + `); + + return expect(content).toMatchFormat(); + }); + + test("breaking maintains calls on the end", () => ( + expect(`{ a: ${long} }.freeze`).toChangeFormat( + `{\n a:\n ${long}\n}.freeze` + ) + )); + + test("breaking with trailing commas", () => { + const expected = `{\n ${long}:\n ${long},\n}`; + + return expect(`{ ${long}: ${long} }`).toChangeFormat(expected, { + addTrailingCommas: true + }); + }); + + test.skip("dynamic symbol hash key", () => ( + expect(`{ 'foo': 'bar' }`).toMatchFormat() + )); + + describe("bare assoc hash", () => { + test("commands", () => ( + expect("foobar alpha: alpha, beta: beta").toMatchFormat() + )); + + test("command calls", () => ( + expect("foo.bar alpha: alpha, beta: beta").toMatchFormat() + )); + + test("calls", () => ( + expect("foobar(alpha: alpha, beta: beta)").toMatchFormat() + )); + + test("does not add trailing commas on breaking commands", () => ( + expect(`foobar ${long}: ${long}, a${long}: a${long}`).toChangeFormat( + ruby(` + foobar ${long}: + ${long}, + a${long}: + a${long} + `), + { addTrailingCommas: true } + ) + )); + + test("does not add trailing commas on breaking command calls", () => ( + expect(`foo.bar ${long}: ${long}, a${long}: a${long}`).toChangeFormat( + ruby(` + foo.bar ${long}: + ${long}, + a${long}: + a${long} + `), + { addTrailingCommas: true } + ) + )); + + test("does add trailing commas on breaking calls", () => ( + expect(`foobar(${long}: ${long}, a${long}: a${long})`).toChangeFormat( + ruby(` + foobar( + ${long}: + ${long}, + a${long}: + a${long}, + ) + `), + { addTrailingCommas: true } + ) + )); + }); + + describe("when hash labels allowed", () => { + test("hash labels stay", () => ( + expect("{ a: 'a', b: 'b', c: 'c' }").toMatchFormat() + )); + + test("hash rockets get replaced", () => ( + expect("{ :a => 'a', :b => 'b', :c => 'c' }").toChangeFormat( + "{ a: 'a', b: 'b', c: 'c' }" + ) + )); + + test("hash rockets stay when needed", () => ( + expect("{ Foo => 1, Bar => 2 }").toMatchFormat() + )); + }); + + describe("when hash labels disallowed", () => { + test("hash labels get replaced", () => ( + expect("{ a: 'a', b: 'b', c: 'c' }").toChangeFormat( + "{ :a => 'a', :b => 'b', :c => 'c' }", + { preferHashLabels: false } + ) + )); + + test("hash rockets stay", () => ( + expect("{ :a => 'a', :b => 'b', :c => 'c' }").toMatchFormat({ + preferHashLabels: false + }) + )); + + test("hash rockets stay when needed", () => ( + expect("{ Foo => 1, Bar => 2 }").toMatchFormat({ + preferHashLabels: false + }) + )); + }); +}); diff --git a/test/js/hooks.test.js b/test/js/hooks.test.js new file mode 100644 index 00000000..a8bfbfec --- /dev/null +++ b/test/js/hooks.test.js @@ -0,0 +1,19 @@ +const { long } = require("./utils"); + +describe.each(["BEGIN", "END"])("%s hook", hook => { + test("shortens to one line", () => ( + expect(`${hook} {\n p 'hook'\n}`).toChangeFormat(`${hook} { p 'hook' }`) + )); + + test("maintains single lines", () => ( + expect(`${hook} { p 'hook' }`).toMatchFormat() + )); + + test("maintains multi line", () => ( + expect(`${hook} {\n ${long}\n}`).toMatchFormat() + )); + + test("expands to multi line", () => ( + expect(`${hook} { ${long} }`).toChangeFormat(`${hook} {\n ${long}\n}`) + )); +}); diff --git a/test/js/kwargs.test.js b/test/js/kwargs.test.js new file mode 100644 index 00000000..3b2e33de --- /dev/null +++ b/test/js/kwargs.test.js @@ -0,0 +1,13 @@ +describe("kwargs", () => { + test("basic", () => ( + expect("def foo(bar: baz); end").toMatchFormat() + )); + + test("optional", () => ( + expect("def foo(bar:); end").toMatchFormat() + )); + + test("double splat", () => ( + expect("def foo(bar:, **baz); end").toMatchFormat() + )); +}); diff --git a/test/js/lambda.test.js b/test/js/lambda.test.js new file mode 100644 index 00000000..64764b96 --- /dev/null +++ b/test/js/lambda.test.js @@ -0,0 +1,83 @@ +const { long, ruby } = require("./utils"); + +describe("lambda", () => { + test("plain stabby lambda literal", () => ( + expect("-> { 1 }").toMatchFormat() + )); + + test("stabby lambda literal with args", () => ( + expect("->(a, b, c) { a + b + c }").toMatchFormat() + )); + + test("stabby lambda literal with arg, no parens", () => ( + expect("-> a { a }").toChangeFormat("->(a) { a }") + )); + + test("stabby lambda with parens, no args", () => ( + expect("-> () { 1 }").toChangeFormat("-> { 1 }") + )); + + test("breaking stabby lambda literal", () => ( + expect(`-> { ${long} }`).toChangeFormat(`lambda do\n ${long}\nend`) + )); + + test("breaking stabby lambda literal with args", () => { + const content = `->(a) { a + ${long} }`; + const expected = `lambda do |a|\n a +\n ${long}\nend`; + + return expect(content).toChangeFormat(expected); + }); + + test("stabby lambda literal within a command node", () => ( + expect("command :foo, ->(arg) { arg + arg }").toMatchFormat() + )); + + test("stabby lambda literal that breaks within a command node", () => ( + expect(`command :foo, -> { ${long} }`).toChangeFormat(ruby(` + command :foo, + lambda { + ${long} + } + `)) + )); + + test("stabby lambda literal with a command call node", () => ( + expect("command.call :foo, ->(arg) { arg + arg }").toMatchFormat() + )); + + test("stabby lambda literal that breaks with a command call node", () => ( + expect(`command.call :foo, -> { ${long} }`).toChangeFormat(ruby(` + command.call :foo, + lambda { + ${long} + } + `)) + )); + + test("very long arguments list doesn't break within pipes", () => { + const content = `command :foo, ->(${long}, a${long}, aa${long}) { true }`; + + return expect(content).toChangeFormat(ruby(` + command :foo, + lambda { |${long}, a${long}, aa${long}| + true + } + `)); + }); + + test("no explicit call adds call", () => ( + expect("a.(1, 2, 3)").toChangeFormat("a.call(1, 2, 3)") + )); + + test("calls maintains call", () => ( + expect("a.call(1, 2, 3)").toMatchFormat() + )); + + test("empty brackets", () => ( + expect("a[]").toMatchFormat() + )); + + test("brackets with multiple args", () => ( + expect("a[1, 2, 3]").toMatchFormat() + )); +}); diff --git a/test/js/layout.test.js b/test/js/layout.test.js new file mode 100644 index 00000000..4b20bf60 --- /dev/null +++ b/test/js/layout.test.js @@ -0,0 +1,13 @@ +describe("layout", () => { + test("turns multiple blank lines into just one blank line", () => ( + expect("1\n\n\n\n\n2").toChangeFormat("1\n\n2") + )); + + test("turns semicolons into adjacent lines", () => ( + expect("1; 2; 3").toChangeFormat("1\n2\n3") + )); + + test("maintains semicolons from within interpolation", () => ( + expect(`"a#{b; c}"`).toMatchFormat() + )); +}); diff --git a/test/js/method.test.js b/test/js/method.test.js new file mode 100644 index 00000000..a256746f --- /dev/null +++ b/test/js/method.test.js @@ -0,0 +1,239 @@ +const { long, ruby } = require("./utils"); + +describe("method", () => { + describe("definitions", () => { + test("shorthand for empty methods", () => ( + expect("def foo; end").toMatchFormat() + )); + + test("shorthand for empty methods with parens", () => ( + expect("def foo(); end").toMatchFormat() + )); + + test("single arg, no parens", () => ( + expect("def foo bar\nend").toChangeFormat("def foo(bar); end") + )); + + test("single arg, with parens", () => ( + expect("def foo(bar)\nend").toChangeFormat("def foo(bar); end") + )); + + test("shorthand for empty singleton methods", () => ( + expect("def self.foo; end").toMatchFormat() + )); + + test("shorthand for empty singleton methods with parens", () => ( + expect("def self.foo(); end").toMatchFormat() + )); + + test("singleton, single arg, no parens", () => ( + expect("def self.foo bar\nend").toChangeFormat("def self.foo(bar); end") + )); + + test("singleton, single arg, with parens", () => ( + expect("def self.foo(bar)\nend").toChangeFormat("def self.foo(bar); end") + )); + + test("shorthand with a body", () => ( + expect("def foo(alpha); 1; end").toChangeFormat( + "def foo(alpha)\n 1\nend" + ) + )); + + test("single splat arg with no name", () => ( + expect("def foo(*); end").toMatchFormat() + )); + + test("double splat arg with no name", () => ( + expect("def foo(**); end").toMatchFormat() + )); + + test("every single arg type", () => { + const content = ruby(` + def method(req, *rest, post, kwarg:, kwarg_opt: 1, **kwarg_rest, &block) + 'foo' + end + `); + + return expect(content).toMatchFormat(); + }); + + test("breaking", () => ( + expect(`def foo(${long}:, a${long}:); end`).toChangeFormat(ruby(` + def foo( + ${long}:, + a${long}: + ); end + `)) + )); + + test.skip("breaking with trailing comma", () => ( + expect(`def foo(${long}:, a${long}:); end`).toChangeFormat( + ruby(` + def foo( + ${long}:, + a${long}:, + ); end + `), + { addTrailingCommas: true } + ) + )); + }); + + describe("method calls", () => { + test("empty parens", () => ( + expect("foo()").toChangeFormat("foo") + )); + + test("single args", () => ( + expect("foo(1)").toMatchFormat() + )); + + test("multi arg", () => ( + expect("foo(1, 2)").toMatchFormat() + )); + + test("just block", () => ( + expect("foo(&block)").toMatchFormat() + )); + + describe("single splat", () => { + test("plain", () => ( + expect("foo(*bar)").toMatchFormat() + )); + + test("with multi args", () => ( + expect("foo(1, 2, *abc)").toMatchFormat() + )); + + test("between multi args", () => ( + expect("foo(1, 2, *abc, 3, 4)").toMatchFormat() + )); + + test("with block", () => ( + expect("foo(*bar, &block)").toMatchFormat() + )); + }); + + describe("double splat", () => { + test("plain", () => ( + expect("foo(**bar)").toMatchFormat() + )); + + test("with block", () => ( + expect("foo(**bar, &block)").toMatchFormat() + )); + + test("with splat and block", () => ( + expect("foo(*bar, **baz, &lock)").toMatchFormat() + )); + + test("after kwarg", () => ( + expect("foo(kwarg: 1, **splat)").toMatchFormat() + )); + + test("before kwarg", () => ( + expect("foo(**splat, kwarg: 1)").toMatchFormat() + )); + + test("before kwargs", () => ( + expect("foo(before: 1, **splat, after: 1)").toMatchFormat() + )); + }); + + describe("different operators", () => { + test("double colon gets changed", () => ( + expect("Foo::foo").toChangeFormat("Foo.foo") + )); + + test("lonely operator", () => ( + expect("foo&.foo").toMatchFormat() + )); + + if (process.env.RUBY_VERSION >= "2.7") { + test("method reference operator", () => ( + expect("foo.:foo").toMatchFormat() + )); + } + }); + + describe("breaking", () => { + describe("without trailing commas", () => { + test("starting with no trailing comma stays", () => ( + expect(`foo(${long}, a${long})`).toChangeFormat( + `foo(\n ${long},\n a${long}\n)` + ) + )); + + test("starting with trailing comma changes", () => ( + expect(`foo(${long}, a${long},)`).toChangeFormat( + `foo(\n ${long},\n a${long}\n)` + ) + )); + + test("with block on the end", () => ( + expect(`foo(${long}, &block)`).toChangeFormat( + `foo(\n ${long},\n &block\n)` + ) + )); + + test("on commands", () => ( + expect(`command ${long}, a${long}`).toChangeFormat(ruby(` + command ${long}, + a${long} + `)) + )); + + test("on command calls", () => ( + expect(`command.call ${long}, a${long}`).toChangeFormat(ruby(` + command.call ${long}, + a${long} + `)) + )); + }); + + describe("with trailing commas", () => { + test("starting with no trailing comma changes", () => ( + expect(`foo(${long}, a${long})`).toChangeFormat( + `foo(\n ${long},\n a${long},\n)`, + { addTrailingCommas: true } + ) + )); + + test("starting with trailing comma stays", () => ( + expect(`foo(${long}, a${long},)`).toChangeFormat( + `foo(\n ${long},\n a${long},\n)`, + { addTrailingCommas: true } + ) + )); + + test("with block on the end", () => ( + expect(`foo(${long}, &block)`).toChangeFormat( + `foo(\n ${long},\n &block\n)`, + { addTrailingCommas: true } + ) + )); + + test("on commands", () => ( + expect(`command ${long}, a${long}`).toChangeFormat( + ruby(` + command ${long}, + a${long} + `), + { addTrailingCommas: true } + ) + )); + + test("on command calls", () => ( + expect(`command.call ${long}, a${long}`).toChangeFormat( + ruby(` + command.call ${long}, + a${long} + `), + { addTrailingCommas: true } + ) + )); + }); + }); + }); +}); diff --git a/test/js/next.test.js b/test/js/next.test.js new file mode 100644 index 00000000..83fe81dc --- /dev/null +++ b/test/js/next.test.js @@ -0,0 +1,17 @@ +describe("next", () => { + test("bare", () => ( + expect("next").toMatchFormat() + )); + + test("one arg, no parens", () => ( + expect("next 1").toMatchFormat() + )); + + test("one arg, with parens", () => ( + expect("next(1)").toChangeFormat("next 1") + )); + + test("multiple args", () => ( + expect("next 1, 2").toMatchFormat() + )); +}); diff --git a/test/nodes.test.js b/test/js/nodes.test.js similarity index 72% rename from test/nodes.test.js rename to test/js/nodes.test.js index 7e837aca..be85e9ce 100644 --- a/test/nodes.test.js +++ b/test/js/nodes.test.js @@ -1,5 +1,7 @@ const { spawnSync } = require("child_process"); -const nodes = require("../src/nodes"); + +const nodes = require("../../src/nodes"); +const print = require("../../src/print"); const expectedUnhandledNodes = [ "arg_ambiguous", @@ -34,11 +36,7 @@ const expectedUnhandledNodes = [ ]; const possibleNodes = () => { - const child = spawnSync("ruby", [ - "-rripper", - "-e", - "puts Ripper::PARSER_EVENTS" - ]); + const child = spawnSync("ruby", ["-rripper", "-e", "puts Ripper::PARSER_EVENTS"]); const error = child.stderr.toString(); if (error) { @@ -53,4 +51,10 @@ describe("node support", () => { const supportedNodes = Object.keys(nodes).concat(expectedUnhandledNodes).sort(); expect(supportedNodes).toEqual(expect.arrayContaining(possibleNodes().sort())); }); + + test("when encountering an unsupported node type", () => { + const path = { getValue: () => ({ type: "unsupported", body: {} }) }; + + expect(() => print(path)).toThrow("Unsupported"); + }); }); diff --git a/test/js/numbers.test.js b/test/js/numbers.test.js new file mode 100644 index 00000000..4ba38b69 --- /dev/null +++ b/test/js/numbers.test.js @@ -0,0 +1,13 @@ +describe("numbers", () => { + test("basic", () => ( + expect("123").toMatchFormat() + )); + + test("preserves sign", () => ( + expect("-123").toMatchFormat() + )); + + test("auto adds o for octal numbers", () => ( + expect("0123").toChangeFormat("0o123") + )); +}); diff --git a/test/js/parser.rb b/test/js/parser.rb new file mode 100644 index 00000000..cfcff025 --- /dev/null +++ b/test/js/parser.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require_relative '../../src/ripper' + +loop do + lines, line = [], nil + lines << line while (line = gets) != "---\n" + + parser = RipperJS.new(lines.join) + + STDOUT.puts JSON.fast_generate(parser.parse) + STDOUT.flush +end diff --git a/test/js/ranges.test.js b/test/js/ranges.test.js new file mode 100644 index 00000000..582099c4 --- /dev/null +++ b/test/js/ranges.test.js @@ -0,0 +1,9 @@ +describe("ranges", () => { + test("two dot", () => ( + expect("1..2").toMatchFormat() + )); + + test("three dot", () => ( + expect("3...4").toMatchFormat() + )); +}); diff --git a/test/js/regexp.test.js b/test/js/regexp.test.js new file mode 100644 index 00000000..ea89afdf --- /dev/null +++ b/test/js/regexp.test.js @@ -0,0 +1,56 @@ +const { ruby } = require("./utils"); + +describe("regexp", () => { + test("basic", () => ( + expect("/abc/").toMatchFormat() + )); + + test("unnecessary braces", () => ( + expect("%r{abc}").toChangeFormat("/abc/") + )); + + test("unnecessary slashes", () => ( + expect("%r/abc/").toChangeFormat("/abc/") + )); + + test("unnecessary brackets", () => ( + expect("%r[abc]").toChangeFormat("/abc/") + )); + + test("unnecessary parens", () => ( + expect("%r(abc)").toChangeFormat("/abc/") + )); + + test("necessary braces", () => ( + expect("%r{a/b/c}").toMatchFormat() + )); + + test("interpolation", () => ( + expect("/a#{inter}c/").toMatchFormat() + )); + + test("modifiers", () => ( + expect("/abc/i").toMatchFormat() + )); + + test("braces and modifiers", () => ( + expect("%r{a/b/c}mi").toMatchFormat() + )); + + test("global interpolation", () => ( + expect("/#$&/").toChangeFormat("/#{$&}/") + )); + + test("comments in regex", () => { + const content = ruby(` + /\\A + [[:digit:]]+ # 1 or more digits before the decimal point + (\\. # Decimal point + [:digit:]]+ # 1 or more digits after the decimal point + )? # The decimal point and following digits are optional + \\Z/x + `); + + return expect(content).toMatchFormat(); + }); +}); diff --git a/test/js/rescue.test.js b/test/js/rescue.test.js new file mode 100644 index 00000000..6e1b80e0 --- /dev/null +++ b/test/js/rescue.test.js @@ -0,0 +1,73 @@ +const { ruby } = require("./utils"); + +describe("rescue", () => { + test("inline", () => ( + expect("a rescue nil").toChangeFormat(ruby(` + begin + a + rescue StandardError + nil + end + `)) + )); + + // from ruby spec/ruby/language/rescue_spec.rb + test("splat errors", () => { + const content = ruby(` + def foo + a + rescue A, *B => e + e + end + `); + + return expect(content).toMatchFormat(); + }); + + test("every clause", () => { + const error = "BreakingBreakingBreakingBreakingBreakingError"; + const content = ruby(` + begin + 1 + rescue ArgumentError + retry + rescue NoMethodError => exception + puts exception + redo + rescue SyntaxError, NoMethodError + 2 + rescue One${error}, Two${error}, Three${error} + 3 + rescue + 4 + else + 5 + ensure + 6 + end + `); + + return expect(content).toChangeFormat(ruby(` + begin + 1 + rescue ArgumentError + retry + rescue NoMethodError => exception + puts exception + redo + rescue SyntaxError, NoMethodError + 2 + rescue One${error}, + Two${error}, + Three${error} + 3 + rescue StandardError + 4 + else + 5 + ensure + 6 + end + `)); + }); +}); diff --git a/test/js/return.test.js b/test/js/return.test.js new file mode 100644 index 00000000..f32f0555 --- /dev/null +++ b/test/js/return.test.js @@ -0,0 +1,21 @@ +describe("return", () => { + test("bare", () => ( + expect("return").toMatchFormat() + )); + + test("one arg, no parens", () => ( + expect("return 1").toMatchFormat() + )); + + test("one arg, with parens", () => ( + expect("return(1)").toChangeFormat("return 1") + )); + + test("multiple args", () => ( + expect("return 1, 2").toMatchFormat() + )); + + test("return method call", () => ( + expect("return foo :bar").toMatchFormat() + )); +}); diff --git a/test/js/setupTests.js b/test/js/setupTests.js new file mode 100644 index 00000000..01963627 --- /dev/null +++ b/test/js/setupTests.js @@ -0,0 +1,74 @@ +const { spawn } = require("child_process"); +const path = require("path"); +const prettier = require("prettier"); +const readline = require("readline"); + +// eslint-disable-next-line no-underscore-dangle +const { formatAST } = prettier.__debug; + +const parser = spawn("ruby", ["./test/js/parser.rb"]); +afterAll(() => parser.kill()); + +const rl = readline.createInterface({ + input: parser.stdout, + output: parser.stdin +}); + +const checkFormat = (before, after, config) => new Promise(resolve => { + const opts = Object.assign({ parser: "ruby", plugins: ["."] }, config); + + rl.question(`${before}\n---\n`, response => { + const { formatted } = formatAST(JSON.parse(response), opts); + + resolve({ + pass: formatted === `${after}\n`, + message: () => `Expected:\n${after}\nReceived:\n${formatted}` + }); + }); +}); + +const realFormat = content => prettier.format(content, { + parser: "ruby", plugins: ["."] +}); + +expect.extend({ + toChangeFormat(before, after, config = {}) { + return checkFormat(before, after, config); + }, + toMatchFormat(before, config = {}) { + return checkFormat(before, before, config); + }, + toFailFormat(before, message) { + let pass = false; + let error = null; + + try { + realFormat(before); + } catch (caught) { + error = caught; + pass = caught.message === message; + } + + return { + pass, + message: () => ` + Expected format to throw an error for ${before} with ${message}, + but got ${error.message} instead + ` + }; + }, + toInferRubyParser(filename) { + const filepath = path.join(__dirname, filename); + const plugin = path.join(__dirname, "..", "..", "src", "ruby"); + + return prettier.getFileInfo(filepath, { plugins: [plugin] }).then( + ({ inferredParser }) => ({ + pass: inferredParser === "ruby", + message: () => ` + Expected prettier to infer the ruby parser for ${filename}, + but got ${inferredParser} instead + ` + }) + ); + } +}); diff --git a/test/js/strings.test.js b/test/js/strings.test.js new file mode 100644 index 00000000..5300e37b --- /dev/null +++ b/test/js/strings.test.js @@ -0,0 +1,333 @@ +const { long, ruby } = require("./utils"); + +describe("strings", () => { + describe("with single quotes", () => { + test("empty single quote strings stay", () => ( + expect("''").toMatchFormat() + )); + + test("empty double quote strings change", () => ( + expect(`""`).toChangeFormat("''") + )); + + test("basic strings with single quotes stay", () => ( + expect("'abc'").toMatchFormat() + )); + + test("basic strings with double quotes change", () => ( + expect(`"abc"`).toChangeFormat("'abc'") + )); + + test("double quotes with inner single quotes stay", () => ( + expect(`"abc's"`).toMatchFormat() + )); + + describe("escape sequences", () => { + test("single quotes stay", () => ( + expect("'abc\\n'").toMatchFormat() + )); + + test("double quotes stay", () => ( + expect(`"abc\\n"`).toMatchFormat() + )); + + test("interpolation within single quotes stay", () => ( + expect(`'#{"\\n"}'`).toMatchFormat() + )); + + test("interpolation within double quotes stay", () => ( + expect(`"#{"\\n"}"`).toMatchFormat() + )); + }); + }); + + describe("with double quotes", () => { + test("empty single quote strings change", () => ( + expect("''").toChangeFormat(`""`, { preferSingleQuotes: false }) + )); + + test("empty double quote strings stay", () => ( + expect(`""`).toMatchFormat({ preferSingleQuotes: false }) + )); + + test("basic strings with single quotes change", () => ( + expect("'abc'").toChangeFormat(`"abc"`, { preferSingleQuotes: false }) + )); + + test("basic strings with double quotes stay", () => ( + expect(`"abc"`).toMatchFormat({ preferSingleQuotes: false }) + )); + + test("double quotes with inner single quotes stay", () => ( + expect(`"abc's"`).toMatchFormat({ preferSingleQuotes: false }) + )); + + describe("escape sequences", () => { + test("single quotes stay", () => ( + expect("'abc\\n'").toMatchFormat() + )); + + test("double quotes stay", () => ( + expect(`"abc\\n"`).toMatchFormat() + )); + + test("interpolation within single quotes stay", () => ( + expect(`'#{"\\n"}'`).toMatchFormat() + )); + + test("interpolation within double quotes stay", () => ( + expect(`"#{"\\n"}"`).toMatchFormat() + )); + }); + }); + + test("concatenation", () => ( + expect(`'abc' \\\n 'def' \\\n 'ghi'`).toMatchFormat() + )); + + describe("interpolation", () => { + test("with keywords", () => ( + expect(`"abc #{super} abc"`).toMatchFormat() + )); + + test("at the beginning of the string", () => ( + expect(`"#{abc} abc"`).toMatchFormat() + )); + + test("very interpolated", () => ( + expect(`"abc #{"abc #{abc} abc"} abc"`).toMatchFormat() + )); + }); + + describe("char literals", () => { + test("single chars get changed", () => ( + expect("?a").toChangeFormat("'a'") + )); + + test("single chars get changed with double quotes", () => ( + expect("?a").toChangeFormat(`"a"`, { preferSingleQuotes: false }) + )); + + test("control escape sequences stay", () => ( + expect("?\\C-a").toMatchFormat() + )); + + test("meta escape sequences stay", () => ( + expect("?\\M-a").toMatchFormat() + )); + + test("meta and control sequences stay", () => ( + expect("?\\M-\\C-a").toMatchFormat() + )); + }); + + describe("xstrings", () => { + test("backtick literals", () => ( + expect("`abc`").toMatchFormat() + )); + + test("breaking backtick literals", () => ( + expect(`\`${long}\``).toChangeFormat(`\`\n ${long}\n\``) + )); + + test("breaking backtick literals with method chains", () => ( + expect(`\`${long}\`.to_s`).toChangeFormat(`\`\n ${long}\n\`.to_s`) + )); + + test("%x literals", () => ( + expect("%x[abc]").toChangeFormat("`abc`") + )); + + test("breaking %x literals", () => ( + expect(`%x[${long}]`).toChangeFormat(`\`\n ${long}\n\``) + )); + + test("breaking %x literals with method chains", () => ( + expect(`%x[${long}].to_s`).toChangeFormat(`\`\n ${long}\n\`.to_s`) + )); + }); + + describe("dynamic symbols", () => { + test("with single quotes", () => ( + expect(":'abc'").toMatchFormat() + )); + + test("with double quotes", () => ( + expect(`:"abc"`).toMatchFormat() + )); + + test("with false interpolation and single quotes", () => ( + expect(":'abc#{foo}abc'").toMatchFormat() + )); + + test("with real interpolation and double quotes", () => ( + expect(`:"abc#{foo}abc"`).toMatchFormat() + )); + }); + + describe("heredocs", () => { + describe("straight", () => { + test("basic", () => { + const content = ruby(` + <<-HERE + This is a straight heredoc + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("with interpolation", () => { + const content = ruby(` + <<-HERE + This is a straight heredoc + #{interpolation} + with interpolation + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on an assignment", () => { + const content = ruby(` + abc = <<-HERE + This is a straight heredoc on an assign + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("nested within another", () => { + const content = ruby(` + <<-PARENT + This is a straight heredoc + #{<<-CHILD + This is an interpolated straight heredoc + CHILD + } + PARENT + `); + + return expect(content).toMatchFormat(); + }); + }); + + describe("squiggly heredocs", () => { + test("basic", () => { + const content = ruby(` + <<~HERE + This is a squiggly heredoc + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("with interpolation", () => { + const content = ruby(` + <<~HERE + This is a squiggly heredoc + #{interpolation} + with interpolation + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on an assignment", () => { + const content = ruby(` + abc = <<~HERE + This is a squiggly heredoc on an assign + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("nested within another", () => { + const content = ruby(` + <<~PARENT + This is a squiggly heredoc + #{<<~CHILD + This is an interpolated squiggly heredoc + CHILD + } + PARENT + `); + + return expect(content).toMatchFormat(); + }); + }); + + describe("as an argument", () => { + test("on calls", () => { + const content = ruby(` + call(1, 2, 3, <<-HERE) + foo + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on calls with multiple", () => { + const content = ruby(` + call(1, 2, 3, <<-HERE, <<-THERE) + here + HERE + there + THERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on commands", () => { + const content = ruby(` + command 1, 2, 3, <<-HERE + foo + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on commands with multiple", () => { + const content = ruby(` + command 1, 2, 3, <<-HERE, <<-THERE + here + HERE + there + THERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on command calls", () => { + const content = ruby(` + command.call 1, 2, 3, <<-HERE + foo + HERE + `); + + return expect(content).toMatchFormat(); + }); + + test("on command calls with multiple", () => { + const content = ruby(` + command.call 1, 2, 3, <<-HERE, <<-THERE + here + HERE + there + THERE + `); + + return expect(content).toMatchFormat(); + }); + }); + }); +}); diff --git a/test/js/super.test.js b/test/js/super.test.js new file mode 100644 index 00000000..ba05b756 --- /dev/null +++ b/test/js/super.test.js @@ -0,0 +1,25 @@ +describe("super", () => { + test("bare", () => ( + expect("super").toMatchFormat() + )); + + test("empty parens", () => ( + expect("super()").toMatchFormat() + )); + + test("one arg, no parens", () => ( + expect("super 1").toMatchFormat() + )); + + test("one arg, with parens", () => ( + expect("super(1)").toMatchFormat() + )); + + test("multiple args, no parens", () => ( + expect("super 1, 2").toMatchFormat() + )); + + test("multiple args, with parens", () => ( + expect("super(1, 2)").toMatchFormat() + )); +}); diff --git a/test/js/utils.js b/test/js/utils.js new file mode 100644 index 00000000..2cff5ce2 --- /dev/null +++ b/test/js/utils.js @@ -0,0 +1,12 @@ +const long = Array(80).fill("a").join(""); + +const ruby = code => { + const lines = code.split("\n"); + + const indent = lines[1].split("").findIndex(char => /[^\s]/.test(char)); + const content = lines.slice(1, lines.length - 1); + + return content.map(line => line.slice(indent)).join("\n"); +}; + +module.exports = { long, ruby }; diff --git a/test/js/while.test.js b/test/js/while.test.js new file mode 100644 index 00000000..00f6177d --- /dev/null +++ b/test/js/while.test.js @@ -0,0 +1,47 @@ +const { long } = require("./utils"); + +describe.each(["while", "until"])("%s", keyword => { + describe("inlines allowed", () => { + test("transforms to inline", () => ( + expect(`${keyword} a\n 1\nend`).toChangeFormat(`1 ${keyword} a`) + )); + + test("maintains inlines", () => ( + expect(`1 ${keyword} a`).toMatchFormat() + )); + + test("breaks on large predicates", () => ( + expect(`${keyword} ${long}\n 1\nend`).toMatchFormat() + )); + + test("breaks inlines on large predicates", () => ( + expect(`1 ${keyword} ${long}`).toChangeFormat( + `${keyword} ${long}\n 1\nend` + ) + )); + }); + + describe("inlines not allowed", () => { + test("maintains multiline", () => ( + expect(`${keyword} a\n 1\nend`).toMatchFormat({ inlineLoops: false }) + )); + + test("transforms to multiline", () => ( + expect(`1 ${keyword} a`).toChangeFormat(`${keyword} a\n 1\nend`, { + inlineLoops: false + }) + )); + + test("breaks on large predicates", () => ( + expect(`${keyword} ${long}\n 1\nend`).toMatchFormat({ + inlineLoops: false + }) + )); + + test("breaks inlines on large predicates", () => ( + expect(`1 ${keyword} ${long}`).toChangeFormat( + `${keyword} ${long}\n 1\nend` + ) + )); + }); +}); diff --git a/test/js/yield.test.js b/test/js/yield.test.js new file mode 100644 index 00000000..a5caa21e --- /dev/null +++ b/test/js/yield.test.js @@ -0,0 +1,21 @@ +describe("yield", () => { + test("bare yield", () => ( + expect("yield").toMatchFormat() + )); + + test("yield with one argument, no parens", () => ( + expect("yield i").toMatchFormat() + )); + + test("yield with one argument, with parens", () => ( + expect("yield(i)").toMatchFormat() + )); + + test("yield with multiple arguments, no parens", () => ( + expect("yield i, 2").toMatchFormat() + )); + + test("yield with multiple arguments, with parens", () => ( + expect("yield(i, 2)").toMatchFormat() + )); +}); diff --git a/test/print.test.js b/test/print.test.js deleted file mode 100644 index 65e85cfa..00000000 --- a/test/print.test.js +++ /dev/null @@ -1,7 +0,0 @@ -const print = require("../src/print"); - -test("when encountering an unsupported node type", () => { - const path = { getValue: () => ({ type: "unsupported", body: {} }) }; - - expect(() => print(path)).toThrow("Unsupported"); -}); diff --git a/test/rake/task_test.rb b/test/rb/rake_test.rb similarity index 94% rename from test/rake/task_test.rb rename to test/rb/rake_test.rb index af050cd7..b4514726 100644 --- a/test/rake/task_test.rb +++ b/test/rb/rake_test.rb @@ -3,7 +3,7 @@ require 'test_helper' require 'prettier/rake/task' -class TaskTest < Minitest::Test +class RakeTest < Minitest::Test Invoke = Struct.new(:args) def test_task diff --git a/test/test_helper.rb b/test/rb/test_helper.rb similarity index 56% rename from test/test_helper.rb rename to test/rb/test_helper.rb index 4fd14ff9..4b93f91d 100644 --- a/test/test_helper.rb +++ b/test/rb/test_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -$LOAD_PATH.unshift(File.expand_path('../lib', __dir__)) +$LOAD_PATH.unshift(File.expand_path('../../lib', __dir__)) require 'prettier' require 'minitest/autorun' diff --git a/test/prettier_test.rb b/test/rb/version_test.rb similarity index 76% rename from test/prettier_test.rb rename to test/rb/version_test.rb index a9924700..9d55356e 100644 --- a/test/prettier_test.rb +++ b/test/rb/version_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class PrettierTest < Minitest::Test +class VersionTest < Minitest::Test def test_version refute_nil ::Prettier::VERSION end diff --git a/test/testRunner.js b/test/testRunner.js deleted file mode 100644 index 85bc7b14..00000000 --- a/test/testRunner.js +++ /dev/null @@ -1,66 +0,0 @@ -const { spawn } = require("child_process"); -const fs = require("fs"); -const path = require("path"); -const prettier = require("prettier"); - -const minitestFiles = [ - "alias.rb", - "array.rb", - "assign.rb", - "binary.rb", - "next.rb", - "numbers.rb", - "kwargs.rb", - "regexp.rb" -]; - -const asyncProcess = child => new Promise((resolve, reject) => ( - child.on("exit", code => { - if (code === 0) { - resolve(); - } else { - reject((child.stdout.read() || child.stderr.read() || "").toString()); - } - }) -)); - -global.runCase = (filename, prettierConfig = {}, rubocopConfig = "default.yml") => { - const file = path.join(__dirname, "cases", filename); - const contents = prettier.format( - fs.readFileSync(file, "utf8"), - Object.assign({}, { parser: "ruby", plugins: ["."] }, prettierConfig) - ); - - describe(filename, () => { - test("matches expected output", () => { - expect(contents).toMatchSnapshot(); - }); - - if (!process.env.NOLINT) { - test("generated code passes rubocop", () => { - const child = spawn("bundle", [ - "exec", "rubocop", "--stdin", file, "--config", `test/config/${rubocopConfig}` - ]); - - child.stdin.write(contents); - child.stdin.end(); - - return asyncProcess(child); - }); - } - - if (minitestFiles.includes(filename)) { - test("generated code passes as a ruby test", () => { - const filepath = `${file.slice(0, -3)}.fmt.rb`; - fs.writeFileSync(filepath, contents); - - const child = spawn("bundle", ["exec", "ruby", "test/test_runner.rb", filepath]); - const ensure = () => fs.unlinkSync(filepath); - - return asyncProcess(child).then(ensure).catch(ensure); - }); - } else { - test.todo("generated code passes as a ruby test"); - } - }); -}; diff --git a/test/test_runner.rb b/test/test_runner.rb deleted file mode 100644 index db37a22b..00000000 --- a/test/test_runner.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -require 'bundler/setup' -require 'minitest/autorun' -require ARGV[0] diff --git a/yarn.lock b/yarn.lock index 41daf13a..ca15c3b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,33 +10,33 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.1.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" - integrity sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw== + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.3.tgz#198d6d3af4567be3989550d97e068de94503074f" + integrity sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helpers" "^7.2.0" - "@babel/parser" "^7.2.2" - "@babel/template" "^7.2.2" - "@babel/traverse" "^7.2.2" - "@babel/types" "^7.2.2" + "@babel/generator" "^7.4.0" + "@babel/helpers" "^7.4.3" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" - lodash "^4.17.10" + lodash "^4.17.11" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0", "@babel/generator@^7.2.2": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.3.0.tgz#f663838cd7b542366de3aa608a657b8ccb2a99eb" - integrity sha512-dZTwMvTgWfhmibq4V9X+LMf6Bgl7zAodRn9PvcPdhlzFMbvUutx74dbEv7Atz3ToeEpevYEJtAwfxq/bDCzHWg== +"@babel/generator@^7.0.0", "@babel/generator@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.0.tgz#c230e79589ae7a729fd4631b9ded4dc220418196" + integrity sha512-/v5I+a1jhGSKLgZDcmAUZ4K/VePi43eRkUs3yePW1HB1iANOD5tqJXwGSG4BZhSksP8J9ejSlwGeTiiOFZOrXQ== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.4.0" jsesc "^2.5.1" - lodash "^4.17.10" + lodash "^4.17.11" source-map "^0.5.0" trim-right "^1.0.1" @@ -61,21 +61,21 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== -"@babel/helper-split-export-declaration@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" - integrity sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag== +"@babel/helper-split-export-declaration@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.0.tgz#571bfd52701f492920d63b7f735030e9a3e10b55" + integrity sha512-7Cuc6JZiYShaZnybDmfwhY4UYHzI6rlqhWjaIqbsJGsIqPimEYy5uh3akSRLMg65LSdSEnJ8a8/bWQN6u2oMGw== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.4.0" -"@babel/helpers@^7.2.0": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.3.1.tgz#949eec9ea4b45d3210feb7dc1c22db664c9e44b9" - integrity sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA== +"@babel/helpers@^7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.3.tgz#7b1d354363494b31cb9a2417ae86af32b7853a3b" + integrity sha512-BMh7X0oZqb36CfyhvtbSmcWc3GXocfxv3yNsAEuM0l+fAqSO22rQrUpijr3oE/10jCTrB6/0b9kzmG4VetCj8Q== dependencies: - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.5" - "@babel/types" "^7.3.0" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" "@babel/highlight@^7.0.0": version "7.0.0" @@ -91,15 +91,10 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.3.tgz#32f5df65744b70888d17872ec106b02434ba1489" integrity sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA== -"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.1.tgz#8f4ffd45f779e6132780835ffa7a215fa0b2d181" - integrity sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA== - -"@babel/parser@^7.1.0": - version "7.3.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" - integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.0", "@babel/parser@^7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.3.tgz#eb3ac80f64aa101c907d4ce5406360fe75b7895b" + integrity sha512-gxpEUhTS1sGA63EGQGuA+WESPR/6tz6ng7tSHFCmaTJK/cGK8y37cBTspX+U2xCAue2IQVvF6Z0oigmjwD8YGQ== "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.2.0" @@ -109,43 +104,43 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/runtime@^7.2.0": - version "7.3.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83" - integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g== + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.3.tgz#79888e452034223ad9609187a0ad1fe0d2ad4bdc" + integrity sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA== dependencies: - regenerator-runtime "^0.12.0" + regenerator-runtime "^0.13.2" -"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" - integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== +"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.0.tgz#12474e9c077bae585c5d835a95c0b0b790c25c8b" + integrity sha512-SOWwxxClTTh5NdbbYZ0BmaBVzxzTh2tO/TeLTbF6MO6EzVhHTnff8CdBXx3mEtazFBoysmEM6GU/wF+SuSx4Fw== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.2.2" - "@babel/types" "^7.2.2" + "@babel/parser" "^7.4.0" + "@babel/types" "^7.4.0" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2": - version "7.2.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" - integrity sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.3.tgz#1a01f078fc575d589ff30c0f71bf3c3d9ccbad84" + integrity sha512-HmA01qrtaCwwJWpSKpA948cBvU5BrmviAief/b3AVw936DtcdsTexlbyzNuDnthwhOQ37xshn7hvQaEQk7ISYQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" + "@babel/generator" "^7.4.0" "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.2.3" - "@babel/types" "^7.2.2" + "@babel/helper-split-export-declaration" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/types" "^7.4.0" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.10" + lodash "^4.17.11" -"@babel/types@^7.0.0", "@babel/types@^7.2.2", "@babel/types@^7.3.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.3.0.tgz#61dc0b336a93badc02bf5f69c4cd8e1353f2ffc0" - integrity sha512-QkFPw68QqWU1/RVPyBe8SO7lXbPfjtqAxRYQKpFpaB8yMq7X2qAqfwK5LKoQufEkSmO5NQ70O6Kc3Afk03RwXw== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.0.tgz#670724f77d24cce6cc7d8cf64599d511d164894c" + integrity sha512-aPvkXyU2SPOnztlgo8n9cEiXW755mgyvueUPcpStqdzoSPm0fjO0vQBjLkt3JKJW7ufikfcnMTTPsN1xaTsBPA== dependencies: esutils "^2.0.2" - lodash "^4.17.10" + lodash "^4.17.11" to-fast-properties "^2.0.0" "@cnakazawa/watch@^1.0.3": @@ -314,9 +309,9 @@ integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@types/babel__core@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" - integrity sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA== + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.1.tgz#ce9a9e5d92b7031421e1d0d74ae59f572ba48be6" + integrity sha512-+hjBtgcFPYyCTo0A15+nxrCVJL7aC6Acg87TXd5OW3QhHswdrOLoles+ldL2Uk8q++7yIfl4tURtztccdeeyOw== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -357,14 +352,14 @@ integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== "@types/yargs@^12.0.2", "@types/yargs@^12.0.9": - version "12.0.9" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0" - integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA== + version "12.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== -abab@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" - integrity sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4= +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== abbrev@1: version "1.1.1" @@ -372,31 +367,37 @@ abbrev@1: integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== acorn-globals@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" - integrity sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ== + version "4.3.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.1.tgz#deb149c59276657ebd40ba2ba849ddd529763ccf" + integrity sha512-gJSiKY8dBIjV/0jagZIFBdVMtfQyA5QHCvAT48H2q8REQoW8Fs5AOjqBql1LgSXgrMWdevcE+8cdZ33NtVbIBA== dependencies: - acorn "^5.0.0" + acorn "^6.0.1" + acorn-walk "^6.0.1" acorn-jsx@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== -acorn@^5.0.0, acorn@^5.3.0: - version "5.5.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" - integrity sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ== +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.7: +acorn@^6.0.1, acorn@^6.0.7: version "6.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== ajv@^6.5.5, ajv@^6.9.1: - version "6.9.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b" - integrity sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg== + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -417,12 +418,7 @@ all-contributors-cli@^6.1.2: request "^2.72.0" yargs "^13.1.0" -ansi-escapes@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== - -ansi-escapes@^3.2.0: +ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== @@ -437,10 +433,10 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" - integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" @@ -535,9 +531,11 @@ arrify@^1.0.1: integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - integrity sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y= + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" @@ -559,7 +557,7 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async@^2.0.0-rc.1, async@^2.5.0, async@^2.6.1: +async@^2.0.0-rc.1, async@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== @@ -572,9 +570,9 @@ asynckit@^0.4.0: integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" - integrity sha1-ri1acpR38onWDdf5amMUoi3Wwio= + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" @@ -600,9 +598,9 @@ babel-jest@^24.7.1: slash "^2.0.0" babel-plugin-istanbul@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz#6892f529eff65a3e2d33d87dc5888ffa2ecd4a30" - integrity sha512-CLoXPRSUWiR8yao8bShqZUIC6qLfZVVY3X1wj+QPNXu0wfmrRRfarh1LYy+dYMVI+bDj0ghy3tuqFFRFZmL1Nw== + version "5.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.1.tgz#7981590f1956d75d67630ba46f0c22493588c893" + integrity sha512-RNNVv2lsHAXJQsEJ5jonQwrJVWK8AcZpG1oxhnjCUaAjL7xahYLANhPUZbzEQHjKy1NMYUwn+0NPKQc8iSY4xQ== dependencies: find-up "^3.0.0" istanbul-lib-instrument "^3.0.0" @@ -650,9 +648,9 @@ base@^0.11.1: pascalcase "^0.1.1" bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" - integrity sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40= + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" @@ -681,9 +679,9 @@ braces@^2.3.1: to-regex "^3.0.1" browser-process-hrtime@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" - integrity sha1-Ql1opY00R/AqBKqJQYf86K+Le44= + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== browser-resolve@^1.11.3: version "1.11.3" @@ -700,14 +698,9 @@ bser@^2.0.0: node-int64 "^0.4.0" buffer-from@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" - integrity sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA== - -builtin-modules@^1.0.0: version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== byline@~5.0.0: version "5.0.0" @@ -735,21 +728,21 @@ call-me-maybe@^1.0.1: integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= callsites@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" - integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camelcase@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" - integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -capture-exit@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" - integrity sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28= +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== dependencies: - rsvp "^3.3.3" + rsvp "^4.8.4" caseless@~0.12.0: version "0.12.0" @@ -830,13 +823,13 @@ collection-visit@^1.0.0: object-visit "^1.0.0" color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" - integrity sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ== + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - color-name "^1.1.1" + color-name "1.1.3" -color-name@^1.1.1: +color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= @@ -848,10 +841,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@~2.17.1: - version "2.17.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== +commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== compare-versions@^3.2.1: version "3.4.0" @@ -878,18 +871,13 @@ contains-path@^0.1.0: resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= -convert-source-map@^1.1.0: +convert-source-map@^1.1.0, convert-source-map@^1.4.0: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== dependencies: safe-buffer "~5.1.1" -convert-source-map@^1.4.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" - integrity sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU= - copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -917,14 +905,14 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: which "^1.2.9" cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" - integrity sha1-uANhcMefB6kP8vFuIihAJ6JDhIs= + version "0.3.6" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" + integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== -"cssstyle@>= 0.3.1 < 0.4.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.3.1.tgz#6da9b4cff1bc5d716e6e5fe8e04fcb1b50a49adf" - integrity sha512-tNvaxM5blOnxanyxI6panOsnfiyLRj3HV4qjqqS45WPNS1usdYWRUQjqTEEELK73lpeP/1KoIGYUwrBn/VcECA== +cssstyle@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" + integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== dependencies: cssom "0.3.x" @@ -936,15 +924,15 @@ dashdash@^1.12.0: assert-plus "^1.0.0" data-urls@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.0.0.tgz#24802de4e81c298ea8a9388bb0d8e461c774684f" - integrity sha512-ai40PPQR0Fn1lD2PPie79CibnlMN2AYiDhwFX/rZHVsxbs5kNJSjegqXIprhouGXlRdEnfybva7kqRGnB6mypA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== dependencies: - abab "^1.0.4" - whatwg-mimetype "^2.0.0" - whatwg-url "^6.4.0" + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" -debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -985,15 +973,7 @@ default-require-extensions@^2.0.0: dependencies: strip-bom "^3.0.0" -define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" - integrity sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ= - dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" - -define-properties@^1.1.3: +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -1070,7 +1050,7 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -domexception@^1.0.0: +domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== @@ -1078,11 +1058,12 @@ domexception@^1.0.0: webidl-conversions "^4.0.2" ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - integrity sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU= + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" + safer-buffer "^2.1.0" emoji-regex@^7.0.1: version "7.0.3" @@ -1103,7 +1084,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.12.0, es-abstract@^1.7.0: +es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== @@ -1115,26 +1096,6 @@ es-abstract@^1.12.0, es-abstract@^1.7.0: is-regex "^1.0.4" object-keys "^1.0.12" -es-abstract@^1.5.1: - version "1.11.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.11.0.tgz#cce87d518f0496893b1a30cd8461835535480681" - integrity sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA== - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.1" - has "^1.0.1" - is-callable "^1.1.3" - is-regex "^1.0.4" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - integrity sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0= - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" - es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -1161,10 +1122,10 @@ escodegen@1.11.0: optionalDependencies: source-map "~0.6.1" -escodegen@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" - integrity sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q== +escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -1295,9 +1256,9 @@ esprima@^3.1.3: integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - integrity sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw== + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1: version "1.0.1" @@ -1528,11 +1489,6 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -1625,14 +1581,14 @@ gauge@~2.7.3: wide-align "^1.1.0" get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" - integrity sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U= + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== get-caller-file@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.1.tgz#25835260d3a2b9665fcdbb08cb039a7bbf7011c0" - integrity sha512-SpOZHfz845AH0wJYVuZk2jWDqFmu7Xubsx+ldIpwzy5pDUpu7OJHK7QYNSA2NPlDSKQwM1GFaAkciOWjjW92Sg== + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-stream@^4.0.0: version "4.1.0" @@ -1666,7 +1622,7 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -1696,12 +1652,7 @@ globby@8.0.2: pify "^3.0.0" slash "^1.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= - -graceful-fs@^4.1.15, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== @@ -1712,11 +1663,11 @@ growly@^1.3.0: integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= handlebars@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a" - integrity sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w== + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== dependencies: - async "^2.5.0" + neo-async "^2.6.0" optimist "^0.6.1" source-map "^0.6.1" optionalDependencies: @@ -1789,9 +1740,9 @@ has@^1.0.1, has@^1.0.3: function-bind "^1.1.1" hosted-git-info@^2.1.4: - version "2.6.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" - integrity sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw== + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== html-encoding-sniffer@^1.0.2: version "1.0.2" @@ -1809,12 +1760,7 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - integrity sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ== - -iconv-lite@^0.4.24, iconv-lite@^0.4.4: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -1945,18 +1891,6 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= - dependencies: - builtin-modules "^1.0.0" - -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" - integrity sha1-hut1OSgF3cM69xySoO7fdO52BLI= - is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -2036,9 +1970,9 @@ is-fullwidth-code-point@^2.0.0: integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-generator-fn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" - integrity sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g== + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^3.1.0: version "3.1.0" @@ -2048,9 +1982,9 @@ is-glob@^3.1.0: is-extglob "^2.1.0" is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== dependencies: is-extglob "^2.1.1" @@ -2061,18 +1995,6 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-odd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" - integrity sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ== - dependencies: - is-number "^4.0.0" - is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -2097,11 +2019,6 @@ is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" - integrity sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI= - is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -2119,6 +2036,11 @@ is-windows@^1.0.2: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2165,11 +2087,6 @@ istanbul-api@^2.1.1: minimatch "^3.0.4" once "^1.4.0" -istanbul-lib-coverage@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#2aee0e073ad8c5f6a0b00e0dfbf52b4667472eda" - integrity sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA== - istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#0b891e5ad42312c2b9488554f603795f9a2211ba" @@ -2182,20 +2099,7 @@ istanbul-lib-hook@^2.0.3: dependencies: append-transform "^1.0.0" -istanbul-lib-instrument@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz#b5f066b2a161f75788be17a9d556f40a0cf2afc9" - integrity sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ== - dependencies: - "@babel/generator" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/template" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - istanbul-lib-coverage "^2.0.1" - semver "^5.5.0" - -istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.1.0: +istanbul-lib-instrument@^3.0.0, istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz#a2b5484a7d445f1f311e93190813fa56dfb62971" integrity sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA== @@ -2587,20 +2491,15 @@ jest@^24.0.0: import-local "^2.0.0" jest-cli "^24.7.1" -js-tokens@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.12.0, js-yaml@^3.13.0: - version "3.13.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.0.tgz#38ee7178ac0eea2c97ff6d96fff4b18c7d8cf98e" - integrity sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ== + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -2611,35 +2510,35 @@ jsbn@~0.1.0: integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsdom@^11.5.1: - version "11.11.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.11.0.tgz#df486efad41aee96c59ad7a190e2449c7eb1110e" - integrity sha512-ou1VyfjwsSuWkudGxb03FotDajxAto6USAlmMZjE2lc0jCznt7sBWkhfRBRaWwbnmDqdMSTKTLT5d9sBFkkM7A== + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== dependencies: - abab "^1.0.4" - acorn "^5.3.0" + abab "^2.0.0" + acorn "^5.5.3" acorn-globals "^4.1.0" array-equal "^1.0.0" cssom ">= 0.3.2 < 0.4.0" - cssstyle ">= 0.3.1 < 0.4.0" + cssstyle "^1.0.0" data-urls "^1.0.0" - domexception "^1.0.0" - escodegen "^1.9.0" + domexception "^1.0.1" + escodegen "^1.9.1" html-encoding-sniffer "^1.0.2" - left-pad "^1.2.0" - nwsapi "^2.0.0" + left-pad "^1.3.0" + nwsapi "^2.0.7" parse5 "4.0.0" pn "^1.1.0" - request "^2.83.0" + request "^2.87.0" request-promise-native "^1.0.5" sax "^1.2.4" symbol-tree "^3.2.2" - tough-cookie "^2.3.3" + tough-cookie "^2.3.4" w3c-hr-time "^1.0.1" webidl-conversions "^4.0.2" whatwg-encoding "^1.0.3" whatwg-mimetype "^2.1.0" whatwg-url "^6.4.1" - ws "^4.0.0" + ws "^5.2.0" xml-name-validator "^3.0.0" jsesc@^2.5.1: @@ -2720,10 +2619,10 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -kleur@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.1.tgz#4f5b313f5fa315432a400f19a24db78d451ede62" - integrity sha512-P3kRv+B+Ra070ng2VKQqW4qW7gd/v3iD8sy/zOdcYRsfiD+QBokQNOps/AfP6Hr48cBhIIBFWckB9aO+IZhrWg== +kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== lcid@^2.0.0: version "2.0.0" @@ -2732,7 +2631,7 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -left-pad@^1.2.0: +left-pad@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== @@ -2791,17 +2690,17 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.11.2, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11: +lodash@^4.11.2, lodash@^4.17.11: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== loose-envify@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" - integrity sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg= + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: - js-tokens "^3.0.0" + js-tokens "^3.0.0 || ^4.0.0" make-dir@^1.3.0: version "1.3.0" @@ -2837,12 +2736,12 @@ map-visit@^1.0.0: object-visit "^1.0.0" mem@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.1.0.tgz#aeb9be2d21f47e78af29e4ac5978e8afa2ca5b8a" - integrity sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg== + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== dependencies: map-age-cleaner "^0.1.1" - mimic-fn "^1.0.0" + mimic-fn "^2.0.0" p-is-promise "^2.0.0" merge-stream@^1.0.1: @@ -2876,24 +2775,12 @@ micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - integrity sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ== - mime-db@~1.38.0: version "1.38.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== -mime-types@^2.1.12: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" - integrity sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ== - dependencies: - mime-db "~1.33.0" - -mime-types@~2.1.19: +mime-types@^2.1.12, mime-types@~2.1.19: version "2.1.22" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== @@ -2905,6 +2792,11 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -2986,16 +2878,15 @@ nan@^2.9.2: integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== nanomatch@^1.2.9: - version "1.2.9" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" - integrity sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA== + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" define-property "^2.0.2" extend-shallow "^3.0.2" fragment-cache "^0.2.1" - is-odd "^2.0.0" is-windows "^1.0.2" kind-of "^6.0.2" object.pick "^1.3.0" @@ -3009,14 +2900,19 @@ natural-compare@^1.4.0: integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.0.tgz#ce3fea21197267bacb310705a7bbe24f2a3a3492" + integrity sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg== dependencies: - debug "^2.1.2" + debug "^4.1.0" iconv-lite "^0.4.4" sax "^1.2.4" +neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -3033,12 +2929,13 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" - integrity sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg== + version "5.4.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== dependencies: growly "^1.3.0" - semver "^5.4.1" + is-wsl "^1.1.0" + semver "^5.5.0" shellwords "^0.1.1" which "^1.3.0" @@ -3067,12 +2964,12 @@ nopt@^4.0.1: osenv "^0.1.4" normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== dependencies: hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" + resolve "^1.10.0" semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" @@ -3118,10 +3015,10 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -nwsapi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.0.tgz#7c8faf4ad501e1d17a651ebc5547f966b547c5c7" - integrity sha512-9kj1oCEDNq+LHDAVPGDPg9+qRcBcpXb1IYC8q89jR8xJvOC2byQwEVsM3W1qQcSPVyzGGaXN7wZHnXORCiZl4w== +nwsapi@^2.0.7: + version "2.1.3" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.3.tgz#25f3a5cec26c654f7376df6659cdf84b99df9558" + integrity sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A== oauth-sign@~0.9.0: version "0.9.0" @@ -3143,14 +3040,9 @@ object-copy@^0.1.0: kind-of "^3.0.3" object-keys@^1.0.11, object-keys@^1.0.12: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.0.tgz#11bd22348dd2e096a045ab06f6c85bcc340fa032" - integrity sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg== - -object-keys@^1.0.8: - version "1.0.11" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" - integrity sha1-xUYBd4rVYPEULODgG8yotW0TQm0= + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object-visit@^1.0.0: version "1.0.1" @@ -3273,9 +3165,9 @@ p-finally@^1.0.0: integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-is-promise@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.0.0.tgz#7554e3d572109a87e1f3f53f6a7d85d1b194f4c5" - integrity sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== p-limit@^1.1.0: version "1.3.0" @@ -3285,9 +3177,9 @@ p-limit@^1.1.0: p-try "^1.0.0" p-limit@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.1.0.tgz#1d5a0d20fb12707c758a655f6bbc4386b5930d68" - integrity sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g== + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== dependencies: p-try "^2.0.0" @@ -3316,14 +3208,14 @@ p-try@^1.0.0: integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= p-try@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" - integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ== + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== parent-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" - integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" @@ -3515,14 +3407,14 @@ progress@2.0.3, progress@^2.0.0, progress@~2.0.0: integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== prompts@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.1.tgz#201b3718b4276fb407f037db48c0029d6465245c" - integrity sha512-8lnEOSIGQbgbnO47+13S+H204L8ISogGulyi0/NNEFAQ9D1VMNTrJ9SBX2Ra03V4iPn/zt36HQMndRYkaPoWiQ== + version "2.0.4" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.4.tgz#179f9d4db3128b9933aa35f93a800d8fce76a682" + integrity sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA== dependencies: - kleur "^3.0.0" + kleur "^3.0.2" sisteransi "^1.0.0" -psl@^1.1.24: +psl@^1.1.24, psl@^1.1.28: version "1.1.31" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== @@ -3540,7 +3432,7 @@ punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -3561,9 +3453,9 @@ rc@^1.2.7: strip-json-comments "~2.0.1" react-is@^16.8.4: - version "16.8.4" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.4.tgz#90f336a68c3a29a096a3d648ab80e87ec61482a2" - integrity sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA== + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== read-pkg-up@^2.0.0: version "2.0.0" @@ -3624,10 +3516,10 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.12.0: - version "0.12.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" - integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== +regenerator-runtime@^0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" + integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" @@ -3648,9 +3540,9 @@ remove-trailing-separator@^1.0.1: integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - integrity sha1-7wiaF40Ug7quTZPrmLT55OEdmQo= + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.6.1: version "1.6.1" @@ -3664,23 +3556,23 @@ request-progress@~3.0.0: dependencies: throttleit "^1.0.0" -request-promise-core@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" - integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== dependencies: - lodash "^4.13.1" + lodash "^4.17.11" request-promise-native@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" - integrity sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU= + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== dependencies: - request-promise-core "1.1.1" - stealthy-require "^1.1.0" - tough-cookie ">=2.3.3" + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" -request@^2.72.0, request@^2.83.0, request@~2.88.0: +request@^2.72.0, request@^2.87.0, request@~2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -3775,24 +3667,17 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@2.6.3, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" -rimraf@^2.5.4: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== - dependencies: - glob "^7.0.5" - -rsvp@^3.3.3: - version "3.6.2" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" - integrity sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw== +rsvp@^4.8.4: + version "4.8.4" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" + integrity sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA== run-async@^2.2.0: version "2.3.0" @@ -3820,19 +3705,19 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3": +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sane@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.0.3.tgz#e878c3f19e25cc57fbb734602f48f8a97818b181" - integrity sha512-hSLkC+cPHiBQs7LSyXkotC3UUtyn8C4FMn50TNaacRyvBlI+3ebcxMpqckmTdtXVtel87YS7GXN3UIOj7NiGVQ== + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== dependencies: "@cnakazawa/watch" "^1.0.3" anymatch "^2.0.0" - capture-exit "^1.2.0" + capture-exit "^2.0.0" exec-sh "^0.3.2" execa "^1.0.0" fb-watchman "^2.0.0" @@ -3845,16 +3730,16 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@~5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -semver@^5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== +semver@~5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -3968,9 +3853,9 @@ source-map-resolve@^0.5.0: urix "^0.1.0" source-map-support@^0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" - integrity sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g== + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -3991,17 +3876,17 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== spdx-correct@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" - integrity sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g== + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" - integrity sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg== + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== spdx-expression-parse@^3.0.0: version "3.0.0" @@ -4012,9 +3897,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" - integrity sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -4029,24 +3914,24 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" - integrity sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s= + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" ecc-jsbn "~0.1.1" + getpass "^0.1.1" jsbn "~0.1.0" + safer-buffer "^2.0.2" tweetnacl "~0.14.0" stack-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" - integrity sha1-1PM6tU6OOHeLDKXP07OvsS22hiA= + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== static-extend@^0.1.1: version "0.1.2" @@ -4056,7 +3941,7 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -stealthy-require@^1.1.0: +stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= @@ -4094,13 +3979,13 @@ string-width@^1.0.1: strip-ansi "^4.0.0" string-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.0.0.tgz#5a1690a57cc78211fffd9bf24bbe24d090604eb1" - integrity sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew== + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== dependencies: emoji-regex "^7.0.1" is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.0.0" + strip-ansi "^5.1.0" string_decoder@~1.1.1: version "1.1.1" @@ -4123,12 +4008,12 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" - integrity sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow== +strip-ansi@^5.0.0, strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: - ansi-regex "^4.0.0" + ansi-regex "^4.1.0" strip-bom@^3.0.0: version "3.0.0" @@ -4146,9 +4031,9 @@ strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" @@ -4188,9 +4073,9 @@ tar@^4: yallist "^3.0.2" test-exclude@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.0.0.tgz#cdce7cece785e0e829cd5c2b27baf18bc583cfb7" - integrity sha512-bO3Lj5+qFa9YLfYW2ZcXMOV1pmQvw+KS/DpjqhyX6Y6UZ8zstpZJ+mA2ERkXfpOqhxsJlQiLeVXD3Smsrs6oLw== + version "5.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.1.0.tgz#6ba6b25179d2d38724824661323b73e03c0c1de1" + integrity sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA== dependencies: arrify "^1.0.1" minimatch "^3.0.4" @@ -4259,12 +4144,13 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@>=2.3.3, tough-cookie@^2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - integrity sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA== +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== dependencies: - punycode "^1.4.1" + psl "^1.1.28" + punycode "^2.1.1" tough-cookie@~2.4.3: version "2.4.3" @@ -4311,11 +4197,11 @@ type-check@~0.3.2: prelude-ls "~1.1.2" uglify-js@^3.1.4: - version "3.4.9" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" - integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== + version "3.5.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.4.tgz#4a64d57f590e20a898ba057f838dcdfb67a939b9" + integrity sha512-GpKo28q/7Bm5BcX9vOu4S46FwisbPbAmkkqPnGIpKvKTM96I85N6XHQV+k4I6FA2wxgLhcsSyHoNhzucwCflvA== dependencies: - commander "~2.17.1" + commander "~2.20.0" source-map "~0.6.1" uid2@0.0.3: @@ -4368,11 +4254,9 @@ urix@^0.1.0: integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= use@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.0.tgz#14716bf03fdfefd03040aef58d8b4b85f3a7c544" - integrity sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw== - dependencies: - kind-of "^6.0.2" + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== util-deprecate@~1.0.1: version "1.0.2" @@ -4393,9 +4277,9 @@ uuid@^3.3.2: integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== validate-npm-package-license@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" - integrity sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g== + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" @@ -4429,21 +4313,30 @@ webidl-conversions@^4.0.2: integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" - integrity sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw== + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: - iconv-lite "0.4.19" + iconv-lite "0.4.24" -whatwg-mimetype@^2.0.0, whatwg-mimetype@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz#f0f21d76cbba72362eb609dbed2a30cd17fcc7d4" - integrity sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew== +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" -whatwg-url@^6.4.0, whatwg-url@^6.4.1: - version "6.4.1" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.1.tgz#fdb94b440fd4ad836202c16e9737d511f012fd67" - integrity sha512-FwygsxsXx27x6XXuExA/ox3Ktwcbf+OAvrKmLulotDAiO1Q6ixchPFaHYsis2zZBZSJTR0+dR+JVtf7MlbqZjw== +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" @@ -4455,9 +4348,9 @@ which-module@^2.0.0: integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.2.9, which@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - integrity sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg== + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" @@ -4507,13 +4400,12 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -ws@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-4.1.0.tgz#a979b5d7d4da68bf54efe0408967c324869a7289" - integrity sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA== +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== dependencies: async-limiter "~1.0.0" - safe-buffer "~5.1.0" xml-name-validator@^3.0.0: version "3.0.0" @@ -4565,9 +4457,9 @@ yargs@^12.0.2: yargs-parser "^11.1.1" yargs@^13.1.0: - version "13.2.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.1.tgz#c8888bcf24424bd4e5a834348366f6fcc37bb8d9" - integrity sha512-HgY0xHGmPPakg6kEDufqxZuXVtvPZcipORC8O7S44iEnwsUmP+qnhReHc6d1dyeIZkrPmYFblh45Z2oeDn++fQ== + version "13.2.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.2.tgz#0c101f580ae95cea7f39d927e7770e3fdc97f993" + integrity sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA== dependencies: cliui "^4.0.0" find-up "^3.0.0"