Sha256: 1538bd38854893154d67d84e21e72d2d46920f99b3064d0117c243449b452aa0

Contents?: true

Size: 646 Bytes

Versions: 1

Compression:

Stored size: 646 Bytes

Contents

require "spec_helper"

feature "instrumenting javascript" do

  before do
    pending("needs istanbul to be installed") unless Teaspoon::Instrumentation.which('istanbul')
  end

  scenario "requesting with instrument=true adds istanbul instrumentation" do
    visit "/assets/instrumented1.js?instrument=true"
    expect(html).to include("if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }")
  end

  scenario "requesting without instrument=true doesn't do anything" do
    visit "/assets/instrumented2.js?instrument=false"
    expect(html).to_not include("if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teaspoon-0.7.4 spec/features/instrumentation_spec.rb