Class: Brut::CLI::Apps::Test::Js
Instance Attribute Summary
#parent_command
Instance Method Summary
collapse
#accepts, #args_description, #argv, #bootstrap?, #commands, #delegate_to_command, #env, #env_vars, #execute, #name, #options, #print, #puts, #stdin, #system!, #theme
Instance Method Details
#default_rack_env ⇒ Object
128
|
# File 'lib/brut/cli/apps/test.rb', line 128
def default_rack_env = "development"
|
#description ⇒ Object
129
|
# File 'lib/brut/cli/apps/test.rb', line 129
def description = "Run JavaScript unit tests"
|
#detailed_description ⇒ Object
133
134
135
|
# File 'lib/brut/cli/apps/test.rb', line 133
def detailed_description = %{
Runs all JavaScript unit tests for the app. This does not support running individual tests.
}
|
#opts ⇒ Object
130
131
132
|
# File 'lib/brut/cli/apps/test.rb', line 130
def opts = [
[ "--[no-]build-assets","Build all assets before running the tests" ],
]
|
#run ⇒ Object
137
138
139
140
141
142
143
144
145
146
|
# File 'lib/brut/cli/apps/test.rb', line 137
def run
options.set_default(:"build-assets", true)
if options.build_assets?
Bundler.with_unbundled_env do
system!("brut build-assets all --env=test")
end
end
execution_context.executor.system!({ "NODE_DISABLE_COLORS" => "1" },"npx mocha #{Brut.container.js_specs_dir} --no-color --extension 'spec.js' --recursive")
0
end
|