Skip to content

Commit

Permalink
switch to jasmine browser runner
Browse files Browse the repository at this point in the history
  • Loading branch information
BeckaL committed Mar 9, 2022
1 parent b64d165 commit 8902b8b
Show file tree
Hide file tree
Showing 11 changed files with 511 additions and 160 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
# Ignore the default SQLite database.
/db/*.sqlite3

# Ignore JavaScript dependencies
/node_modules

# Ignore compiled assets
/public/assets

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

/coverage
/spec/reports

/node_modules
/yarn-error.log
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ end

group :development, :test do
gem "govuk_test"
gem "jasmine"
gem "jasmine_selenium_runner"
gem "pry-byebug"
gem "pry-rails"
gem "rspec-rails"
Expand Down
12 changes: 0 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,6 @@ GEM
domain_name (~> 0.5)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
jasmine (3.6.0)
jasmine-core (~> 3.6.0)
phantomjs
rack (>= 1.2.1)
rake
jasmine-core (3.6.0)
jasmine_selenium_runner (3.0.0)
jasmine (~> 3.0)
selenium-webdriver (~> 3.8)
jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
Expand Down Expand Up @@ -288,7 +279,6 @@ GEM
hashery (~> 2.0)
ruby-rc4
ttfunk
phantomjs (2.1.1.0)
plek (4.0.0)
power_assert (1.2.0)
prometheus_exporter (2.0.2)
Expand Down Expand Up @@ -522,8 +512,6 @@ DEPENDENCIES
govuk_publishing_components
govuk_sidekiq
govuk_test
jasmine
jasmine_selenium_runner
listen
mini_magick
mongo
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ require File.expand_path("config/application", __dir__)
Rails.application.load_tasks

Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
task default: %i[lint spec jasmine:ci]
task default: %i[lint spec jasmine]
4 changes: 4 additions & 0 deletions lib/tasks/jasmine.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
desc "Run Jasmine tests"
task jasmine: :environment do
sh "yarn run jasmine:ci"
end
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"scripts": {
"lint": "yarn run lint:js && yarn run lint:scss",
"lint:js": "standardx 'app/assets/javascripts/**/*.js' 'spec/javascripts/**/*.js'",
"lint:scss": "stylelint app/assets/stylesheets/"
"lint:scss": "stylelint app/assets/stylesheets/",
"jasmine:prepare": "RAILS_ENV=test bundle exec rails assets:clobber assets:precompile",
"jasmine:ci": "yarn run jasmine:prepare && yarn run jasmine-browser-runner runSpecs",
"jasmine:browser": "yarn run jasmine:prepare && yarn run jasmine-browser-runner"
},
"standardx": {
"env": {
Expand All @@ -30,6 +33,8 @@
"extends": "stylelint-config-gds/scss"
},
"devDependencies": {
"jasmine-browser-runner": "^1.0.0",
"jasmine-core": "^4.0.1",
"standardx": "^7.0.0",
"stylelint": "^13.13.1",
"stylelint-config-gds": "^0.1.0"
Expand Down
124 changes: 0 additions & 124 deletions spec/javascripts/support/jasmine.yml

This file was deleted.

7 changes: 0 additions & 7 deletions spec/javascripts/support/jasmine_helper.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/javascripts/support/jasmine_selenium_runner.yml

This file was deleted.

18 changes: 18 additions & 0 deletions spec/support/jasmine-browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"srcDir": "public/assets",
"srcFiles": [
"govuk-admin-template-*.js",
"application-*.js"
],
"cssFiles": [
"application-*.css"
],
"specDir": "spec/javascripts",
"specFiles": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/*.js"
],
"browser": "headlessChrome"
}
Loading

0 comments on commit 8902b8b

Please sign in to comment.