Class: Jscov::Bless

Inherits:
Object
  • Object
show all
Defined in:
lib/jscov/bless.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Bless

Returns a new instance of Bless.



3
4
5
# File 'lib/jscov/bless.rb', line 3

def initialize(response)
  @response = response
end

Class Method Details

.js_codeObject



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/jscov/bless.rb', line 56

def js_code
  "    window.addEventListener(\"unload\", __jscov_dumpCoverage)\n\n    function __jscov_dumpCoverage() {\n      const cov = window.__coverage__\n      if (!cov) { return }\n\n      console.log('__jscov', JSON.stringify(cov))\n    }\n  JS\nend\n"

Instance Method Details

#resultObject



7
8
9
10
11
12
13
# File 'lib/jscov/bless.rb', line 7

def result
  [
    @response[0],
    headers,
    blessed_body,
  ]
end