test/config.rb in rails-graphql-0.2.1 vs test/config.rb in rails-graphql-1.0.0.beta

- old
+ new

@@ -2,28 +2,36 @@ SimpleCov.start do coverage_criterion :branch add_filter '/test/' - add_group 'Definition', ['/graphql/type', '/graphql/introspection', '/graphql/schema'] - add_group 'Source', '/graphql/source' - add_group 'Native', '/graphql/native' - add_group 'Field', '/graphql/field' + add_group 'Definition', ['/graphql/type', '/graphql/directive'] + add_group 'Field', ['/graphql/alternative', '/graphql/field'] add_group 'Helpers', '/graphql/helpers' - add_group 'Request', '/graphql/request' + add_group 'Rails', '/graphql/railties' + add_group 'Request', ['/graphql/collectors', '/graphql/request'] + add_group 'Subscription', '/graphql/subscription' + add_group 'Source', ['/graphql/adapters', '/graphql/source'] end require 'minitest/autorun' require 'minitest/reporters' +require 'active_record' require 'rails-graphql' -require 'pry' +require 'debug' +$config = Rails::GraphQL.config +$config.logger = ActiveSupport::TaggedLogging.new(Logger.new('/dev/null')) +Rails::GraphQL::Request::Backtrace.skip_base_class = NilClass + +# ActiveRecord::Base.logger = Logger.new(STDOUT) + require_relative './test_ext' Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new) -# Load all files for coverage ensurance +# Load all files for coverage insurance Rails::GraphQL.eager_load! module GraphQL class TestCase < Minitest::Test PASSTHROUGH = ->(x, *) { x } @@ -59,10 +67,12 @@ result.define_singleton_method(:new) { |**xargs| xargs } result end def fake_type_map(pass = :fetch!, *others) - double(**others.unshift(pass).map { |m| [m, passthrough] }.to_h) + methods = others.unshift(pass).product([passthrough]).to_h + methods[:associated_namespace_of] ||= ->(*) { } + double(**methods) end def stubbed_type_map(*others, &block) Rails::GraphQL.stub(:type_map, fake_type_map(*others), &block) end