importmap_mocha-rails 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/importmap.rb +16 -0
- data/lib/importmap_mocha/engine.rb +50 -0
- data/lib/importmap_mocha/version.rb +5 -0
- data/lib/importmap_mocha-rails.rb +5 -0
- data/lib/tasks/importmap_mocha/rails_tasks.rake +4 -0
- data/vendor/javascripts/@mswjs--interceptors--presets--browser.js +1146 -0
- data/vendor/javascripts/@mswjs--interceptors.js +238 -0
- data/vendor/javascripts/@open-draft--deferred-promise.js +2 -0
- data/vendor/javascripts/@open-draft--logger.js +2 -0
- data/vendor/javascripts/@open-draft--until.js +2 -0
- data/vendor/javascripts/chai.js +260 -0
- data/vendor/javascripts/is-node-process.js +2 -0
- data/vendor/javascripts/mocha.js +20635 -0
- data/vendor/javascripts/mocha.js.map +1 -0
- data/vendor/javascripts/outvariant.js +2 -0
- data/vendor/javascripts/strict-event-emitter.js +2 -0
- data/vendor/stylesheets/mocha.css +392 -0
- metadata +18 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 956db9517ae928bdba1055e2fa794e0a5268e5cd51fbd5ee77b3d2f581974863
|
4
|
+
data.tar.gz: 82ea0c468ab45e738ee23a35b2c3342e20fc2db5e83ffb2cad1695ff32f6d9e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd744f1ccb15cadea9a96a17950763a518ad8ed752ec01a3ad8c49320e08cd3232dd44b21c4f17ae3cb49e4ab0d828e9c9f38f3387dbe51596af125877cf6646
|
7
|
+
data.tar.gz: 6b78eb3f5d241937458ae8ce568fe86eb743db54decd9841fe87f5517371d532e59292fd5b8e694042f36a5e928c75326fe4dd386491e5710316ed635fe97ebb
|
data/config/importmap.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
pin "importmap_mocha"
|
2
|
+
|
3
|
+
pin "@mswjs/interceptors", to: "@mswjs--interceptors.js"
|
4
|
+
pin "@mswjs/interceptors/presets/browser" , to: "@mswjs--interceptors--presets--browser.js"
|
5
|
+
pin "chai", to: "chai.js"
|
6
|
+
|
7
|
+
pin "@open-draft/logger", to: "@open-draft--logger.js" # @0.3.0
|
8
|
+
pin "is-node-process", to: "is-node-process.js" # @1.2.0
|
9
|
+
pin "outvariant", to: "outvariant.js" # @1.4.0
|
10
|
+
pin "@open-draft/until", to: "@open-draft--until.js" # @2.1.0
|
11
|
+
pin "@open-draft/deferred-promise", to: "@open-draft--deferred-promise.js" # @2.2.0
|
12
|
+
pin "strict-event-emitter", to: "strict-event-emitter.js" # @0.5.1
|
13
|
+
|
14
|
+
Rails.application.config.importmap_mocha_path.each do |path|
|
15
|
+
pin_all_from path
|
16
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ImportmapMocha
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
config.before_initialize do
|
6
|
+
Rails.application.config.importmap_mocha_path = []
|
7
|
+
%w[test spec].each do |d|
|
8
|
+
path = Rails.root.join(d, 'javascripts')
|
9
|
+
Rails.application.config.importmap_mocha_path << path if path.exist?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
initializer 'importmap_mocha.assets' do
|
14
|
+
if Rails.application.config.respond_to?(:assets)
|
15
|
+
Rails.application.config.assets.paths << Engine.root.join('app/assets/javascripts')
|
16
|
+
Rails.application.config.assets.paths << Engine.root.join('app/assets/stylesheets')
|
17
|
+
Rails.application.config.assets.paths << Engine.root.join('vendor/javascripts')
|
18
|
+
Rails.application.config.assets.paths << Engine.root.join('vendor/stylesheets')
|
19
|
+
Rails.application.config.assets.paths += Rails.application.config.importmap_mocha_path
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
PRECOMPILE_ASSETS = %w[importmap_mocha.js chai.js mocha.js mocha.css].freeze
|
24
|
+
|
25
|
+
initializer 'turbo.assets' do
|
26
|
+
Rails.application.config.assets.precompile += PRECOMPILE_ASSETS if Rails.application.config.respond_to?(:assets)
|
27
|
+
end
|
28
|
+
|
29
|
+
initializer 'importmap_mocha.importmap', before: 'importmap' do |app|
|
30
|
+
app.config.importmap.paths << Engine.root.join('config/importmap.rb') if Rails.application.respond_to?(:importmap)
|
31
|
+
end
|
32
|
+
|
33
|
+
initializer 'importmap_mocha.routes' do
|
34
|
+
Rails.application.routes.prepend do
|
35
|
+
scope module: 'importmap_mocha' do
|
36
|
+
get '/rails/info/mocha' => 'test#index'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
initializer 'importmap_mocha.config' do
|
42
|
+
unless Rails.application.config.respond_to?(:importmap_mocha_style)
|
43
|
+
Rails.application.config.importmap_mocha_style = 'bdd'
|
44
|
+
end
|
45
|
+
unless Rails.application.config.respond_to?(:importmap_mocha_scripts)
|
46
|
+
Rails.application.config.importmap_mocha_scripts = []
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|