Class: LearnLab::Test::Strategies::Mocha
Overview
Instance Attribute Summary
#fs, #options, #out, #runner
Instance Method Summary
collapse
#cleanup, #initialize, #output, #result_filename, #results
Instance Method Details
permalink
#check_dependencies ⇒ Object
[View source]
9
10
11
12
|
# File 'lib/learn_lab/test/strategies/mocha.rb', line 9
def check_dependencies
msg = 'Please install NodeJS: https://nodejs.org/en/download'
raise MissingDependencyError.new(msg) if `which node`.empty?
end
|
[View source]
14
15
16
|
# File 'lib/learn_lab/test/strategies/mocha.rb', line 14
def detect
js_dependency?(:mocha) || js_dependency?(:'learn-browser')
end
|
[View source]
18
19
20
21
22
23
24
25
26
|
# File 'lib/learn_lab/test/strategies/mocha.rb', line 18
def run
command = if js_dependency?(:'learn-browser') || js_test_script?
'npm test'
else
'node_modules/.bin/mocha -R mocha-multi ' \
"--reporter-options spec=-,json=#{result_filename}"
end
system(command)
end
|