Skip to content

Commit 1008105

Browse files
committed
tweaks
1 parent 1d015a5 commit 1008105

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

example/cypress/support/e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ***********************************************************
2-
// This example support/e2e.ts is processed and
2+
// This example support/e2e.js is processed and
33
// loaded automatically before your test files.
44
//
55
// This is a great place to put global configuration and

lib/cypress-rails/init.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module CypressRails
22
class Init
3-
DEFAULT_CONFIG = <<~CYPRESS_CONFIG
3+
DEFAULT_CONFIG = <<~JS
44
const { defineConfig } = require('cypress')
55
66
module.exports = defineConfig({
@@ -17,16 +17,16 @@ class Init
1717
videosFolder: "tmp/cypress_videos",
1818
trashAssetsBeforeRuns: false
1919
})
20-
CYPRESS_CONFIG
20+
JS
2121

2222
def call(dir = Dir.pwd)
2323
config_path = File.join(dir, "cypress.config.js")
24-
if File.exist?(config_path)
25-
warn('Cypress config is already exist!')
26-
return
24+
if !File.exist?(config_path)
25+
File.write(config_path, DEFAULT_CONFIG)
26+
puts "Cypress config initialized in `#{config_path}'"
27+
else
28+
warn "Cypress config already exists in `#{config_path}'. Skipping."
2729
end
28-
File.write(config_path, DEFAULT_CONFIG)
29-
puts "Cypress config initialized in #{config_path}"
3030
end
3131
end
3232
end

0 commit comments

Comments
 (0)