cypress-rails 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b093a78636180632c4ce0b8ca2676c576601567bd27d536fb63b7eb0f65dcc55
4
- data.tar.gz: e22ee94a3417062864d003405e66f24e3e120ba519fba2c7f3ff5b3a35788c80
3
+ metadata.gz: ff1a69096cba0508c006c7ec8d96796c12026e8ef0e89956eab2af77112a7c96
4
+ data.tar.gz: ec1076a20ae68ae94359cb35ce81b63b515857eb239fb361da4953d935c400a9
5
5
  SHA512:
6
- metadata.gz: c40265543d3f949ed4f3968ca64fffc3a9c0e00136593b7eca96bf1600bc4e9843a4b181c2af7923cb75bf08ee95a772f8c30660309b453c9251feb77448c1cb
7
- data.tar.gz: 1eace28c079abe961bd36c889c12f944acdd8ccf0c54f451959734efaab173da5e038503824bc2c0b39f53ff0c185a040a862316f059bfca4a9128a859012435
6
+ metadata.gz: a3d7559054e9c3a3d67190294253f7df4994a5d784f25bb4aac2782d65eaa03437d53a612ed9b1559ea405b34e661a1ad9203f1e737253403a9a3d5e512c1680
7
+ data.tar.gz: 244632d0f95e460ada182b882a0d95cd618264cf10434b337698bbc1c45e9eb40cfa7499b8398b30568ec36a422755228fe2ec9ff36a77bb5608c66d4560ffd5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.9.2
4
+
5
+ * Fix `rake cypress:init` so it recognizes an existing Cypress config file of
6
+ any supported extension (`.js`, `.ts`, `.mjs`, `.cjs`, `.mts`, `.cts`)
7
+ instead of only `cypress.config.js` [#170](https://github.com/testdouble/cypress-rails/issues/170)
8
+
3
9
  ## 0.9.1
4
10
 
5
11
  * Add `CYPRESS_RAILS_SERVER_THREADS` (default: `"0:4"`) to configure the min:max
@@ -1,5 +1,7 @@
1
1
  module CypressRails
2
2
  class Init
3
+ CONFIG_EXTENSIONS = %w[js ts mjs cjs mts cts]
4
+
3
5
  DEFAULT_CONFIG = <<~JS
4
6
  const { defineConfig } = require('cypress')
5
7
 
@@ -20,12 +22,13 @@ module CypressRails
20
22
  JS
21
23
 
22
24
  def call(cypress_dir = Config.new.cypress_dir)
23
- config_path = File.join(cypress_dir, "cypress.config.js")
24
- if !File.exist?(config_path)
25
+ existing_config_path = Dir.glob(File.join(cypress_dir, "cypress.config.{#{CONFIG_EXTENSIONS.join(",")}}")).first
26
+ if existing_config_path
27
+ warn "Cypress config already exists in `#{existing_config_path}'. Skipping."
28
+ else
29
+ config_path = File.join(cypress_dir, "cypress.config.js")
25
30
  File.write(config_path, DEFAULT_CONFIG)
26
31
  puts "Cypress config initialized in `#{config_path}'"
27
- else
28
- warn "Cypress config already exists in `#{config_path}'. Skipping."
29
32
  end
30
33
  end
31
34
  end
@@ -1,7 +1,7 @@
1
1
  require "pathname"
2
2
  CLI = Pathname.new(File.dirname(__FILE__)).join("../../exe/cypress-rails")
3
3
 
4
- desc "Initialize cypress.config.js"
4
+ desc "Initialize Cypress config"
5
5
  task :"cypress:init" do
6
6
  system "#{CLI} init"
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module CypressRails
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls