Sha256: 87b742b1dc6b7beb23a85ff4cd69fc83e93c5f8b3ff1585e3f4c2f9db3686f07

Contents?: true

Size: 681 Bytes

Versions: 2

Compression:

Stored size: 681 Bytes

Contents

require 'rails_helper'
require 'jslint'
require 'rbconfig'

# OSX has its own java executable that opens a prompt to install Java 💩
# However this java_home executable returns an error code without opening the prompt ✅
RbConfig::CONFIG['host_os'].include?('darwin') ? `/usr/libexec/java_home` : `which java`
java_installed = $?.success?

RSpec.describe 'Javascript', type: :request, if: java_installed do
  let(:lint) {
    JSLint::Lint.new \
      paths:         ['public/javascripts/**/*.js'],
      exclude_paths: ['public/javascripts/vendor/**/*.js'],
      config_path:   'spec/support/jslint.yml'
  }

  it 'should not have any syntax errors' do
    lint.run
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activeadmin-1.0.0 spec/requests/javascript_spec.rb
activeadmin-1.0.0.pre5 spec/requests/javascript_spec.rb