Skip to content

Commit fa4db5e

Browse files
committed
Fix tests
1 parent 1ed0f24 commit fa4db5e

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

lib/js_routes/instance.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,8 @@ def js_variables
9292
prefix = @configuration.prefix
9393
prefix = prefix.call if prefix.is_a?(Proc)
9494
{
95-
# 'GEM_VERSION' => JsRoutes::VERSION,
9695
'ROUTES_OBJECT' => routes_object,
97-
# 'RAILS_VERSION' => ::Rails.version,
9896
'DEPRECATED_FALSE_PARAMETER_BEHAVIOR' => Rails.version < '7.0.0',
99-
# 'APP_CLASS' => application.class.to_s,
10097
'DEFAULT_URL_OPTIONS' => json(@configuration.default_url_options),
10198
'PREFIX' => json(prefix),
10299
'SPECIAL_OPTIONS_KEY' => json(@configuration.special_options_key),

spec/js_routes/module_types/dts/routes.spec.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/**
2-
* File generated by js-routes 2.3.1 on 2024-12-03 19:55:47 +0100
3-
* Based on Rails 7.2.0 routes of App
4-
*/
51
declare type Optional<T> = {
62
[P in keyof T]?: T[P] | null;
73
};

spec/js_routes/module_types/dts_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
end
2828

2929
context "when file is generated" do
30+
let(:extra_options) do
31+
{ banner: nil }
32+
end
33+
3034
let(:dir_name) do
3135
File.expand_path(__dir__ + "/dts")
3236
end

spec/js_routes/options_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,4 +508,13 @@
508508
expect(generated_js).not_to include("@returns")
509509
end
510510
end
511+
512+
describe "banner option" do
513+
let(:_options) { {banner: nil} }
514+
515+
it "disables banner generation" do
516+
expect(generated_js).not_to include("File generated by js-routes")
517+
expect(generated_js).not_to include("Based on Rails")
518+
end
519+
end
511520
end

0 commit comments

Comments
 (0)